The key of the value to retrieve
A cloned copy of the stored value, or defaultValue if the key has no value
Get a value from the shared store, waiting for the shared store service to be initialized first.
Unlike get, this waits (via waitForInitialization) until the shared store service
is initialized, then reads synchronously. A key with a live value returns that value — which may
legitimately be undefined. A key that is absent or has been removed has no value: with no
defaultValue argument this throws; with a defaultValue (which may itself be undefined) it
returns that default.
If the shared store service is already initialized, the awaited promise is already settled, so execution continues here on the next microtask without yielding to timers or other queued macrotasks — effectively synchronous from the caller's perspective. Note the returned value may not reflect the most up-to-date value, since changes from other processes arrive asynchronously.
The key of the value to retrieve
Returned when the key has no value. Omit to throw instead.
A cloned copy of the stored value, or defaultValue if the key has no value
Get a value from the shared store, waiting for the shared store service to be initialized first.
Unlike get, this waits (via waitForInitialization) until the shared store service is initialized, then reads synchronously. A key with a live value returns that value — which may legitimately be
undefined. A key that is absent or has been removed has no value: with nodefaultValueargument this throws; with adefaultValue(which may itself beundefined) it returns that default.If the shared store service is already initialized, the awaited promise is already settled, so execution continues here on the next microtask without yielding to timers or other queued macrotasks — effectively synchronous from the caller's perspective. Note the returned value may not reflect the most up-to-date value, since changes from other processes arrive asynchronously.