Creates a new SSRExecutorManager instance.
Additional options.
Protected
_Predicate that executors must satisfy to be hydrated on the client with the state accumulated during SSR.
Protected
Readonly
_The map from a key to an executor.
Protected
_Map from an executor to a version of the state that was sent to the client for hydration.
Protected
Readonly
_The map from a key ID to an initial state that must be set to an executor before plugins are applied. Entries from this map are deleted after the executor is created.
Protected
Readonly
_Plugins that are applied to all executors.
Protected
Readonly
_The pubsub that handles the manager subscriptions.
Protected
_Stringifies executor keys and state snapshots before sending them to the client.
Readonly
keyReturns the unique comparable ID for the executor key.
A nonce string to allow hydration scripts under a
script-src
Content-Security-Policy.
Iterates over executors created by the manager.
Instantly aborts all pending executors and preserves their available results as is.
Optional
reason: unknownThe abort reason that is used for rejection of the pending task promises.
Deletes the non-active executor from the manager.
If the detached executor is pending then it is not aborted. Subscribe to the detach event on either manager or an executor and abort it manually.
The key of the executor to delete.
true
if the executor was detached, or false
if there's no such executor, or the executor is active.
Returns an executor by its key, or undefined
if there's no such executor.
The unique executor key.
Resolves with the existing executor or waits for an executor to be created.
The executor key to wait for.
Returns an existing executor or creates a new one.
The unique executor key.
The initial executor value.
Optional
plugins: (undefined | null | ExecutorPlugin<Value>)[]The array of plugins that are applied to the newly created executor.
Returns an existing executor or creates a new one.
The unique executor key.
Optional
initialValue: Value | ExecutorTask<Value> | PromiseLike<Value>The initial executor value.
Optional
plugins: (undefined | null | ExecutorPlugin<NoInfer<Value>>)[]The array of plugins that are applied to the newly created executor.
Resolves with true
if the nextHydrationChunk is non-empty.
Injects the initial state for the executor that can be created in the future.
The unique executor key.
The initial state of the hydrated executor that can be created via ExecutorManager.getOrCreate.
true
if the executor has been hydrated, or false
if the executor has already been created and
therefore cannot be hydrated.
Returns an inline <script>
tag with source that hydrates the client with the state accumulated during SSR,
or an empty string if there are no state changes since the last time nextHydrationScriptSource was called.
Returns a script source that hydrates the client with the state accumulated during SSR, or an empty string if there are no state changes since the last time nextHydrationScriptSource was called.
Subscribes a listener to the events published by all executors that are created by this manager.
The listener to subscribe.
The callback that unsubscribes the listener.
The base implementation of the executor manager that supports client hydration after SSR.