Creates a new SSR executor manager.
Manager options.
Protected_Selects executors whose state is sent to the client.
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.
ReadonlykeyReturns the ID of an executor key. Keys with the same ID refer to the same executor.
A nonce string to allow hydration scripts under a
script-src Content-Security-Policy.
Iterates over executors created by the manager.
Aborts the pending tasks of all executors. The executor results are preserved as is.
Optionalreason: unknown
The reason that rejects the aborted task promises.
Detaches an executor that isn't active from the manager.
A pending task of the detached executor isn't aborted. To abort it, subscribe to the detached event.
The unique executor key.
true if the executor was detached, or false if there's no such executor or it's active.
Returns an executor by its key, or undefined if there's no such executor.
The unique executor key.
Resolves with the executor that has the key, and waits for the executor to be created if it doesn't exist yet.
If the signal is aborted, the promise is rejected with the abort reason.
The unique executor key.
Options with the signal that aborts waiting.
Optionalsignal?: AbortSignalThe signal that aborts the operation.
Returns an existing executor or creates a new one.
If a plugin throws, the pending task of the new executor is aborted, the detached event is published, and the error is rethrown.
The unique executor key.
The initial value of a new executor: a value, a promise, or a task callback to execute. It isn't applied if plugins have already settled the executor or started a task.
Optionalplugins: (ExecutorPlugin<Value> | null | undefined)[]
Plugins that are applied to a new executor.
Returns an existing executor or creates a new one.
If a plugin throws, the pending task of the new executor is aborted, the detached event is published, and the error is rethrown.
The unique executor key.
OptionalinitialValue: Value | ExecutorTaskCallback<Value> | PromiseLike<Value>
The initial value of a new executor: a value, a promise, or a task callback to execute. It isn't applied if plugins have already settled the executor or started a task.
Optionalplugins: (ExecutorPlugin<NoInfer<Value>> | null | undefined)[]
Plugins that are applied to a new executor.
Waits until no executors are pending, and resolves with true if the state of any executor has changed since
this method was called, or false otherwise. Use it to re-render the app on the server until all data is loaded.
The returned promise is rejected if executors are still pending after maxRetries attempts. This usually means
that a plugin keeps re-executing tasks during SSR.
The maximum number of times to wait for executors that become pending again. Increase it if data is loaded in many sequential steps.
Sets the initial state of an executor that hasn't been created yet. The state is applied when the executor is created with getOrCreate.
The unique executor key.
The initial state of the executor.
true if the initial state was set, or false if the executor already exists.
Returns a <script> tag that sends the client the states of executors that have changed since they were last
sent, or an empty string if there are no such changes.
Returns the source of a script that sends the client the states of executors that have changed since they were last sent, or an empty string if there are no such changes.
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 executor manager that sends executor states to the client during server-side rendering.