Creates a new ReadableSSRExecutorManager instance.
Optional
options: SSRExecutorManagerOptionsAdditional options.
Protected
_executorFilters executors that must be hydrated on the client with the state that was accumulated during SSR.
Protected
Readonly
_executorsThe map from a key to an executor.
Protected
_hydratedMap from an executor to a version of the state that was sent to the client for hydration.
Protected
Readonly
_initialThe map from a key 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 initialized.
Protected
Readonly
_pluginsPlugins that are applied to all executors.
Protected
Readonly
_pubThe pubsub that handles the manager subscriptions.
Protected
_stateStringifies the state of the executor before sending it to the client.
Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
A JavaScript value, usually an object or array, to be converted.
Optional
replacer: ((this: any, key: string, value: any) => any)A function that transforms the results.
Optional
space: string | numberAdds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
A JavaScript value, usually an object or array, to be converted.
Optional
replacer: null | (string | number)[]An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified.
Optional
space: string | numberAdds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
Readonly
keySerializes keys of executors.
A nonce string to allow scripts for
script-src
Content-Security-Policy.
Readonly
readableReadonly
writableProvides a convenient, chainable way of piping this readable stream through a transform stream (or any other { writable, readable } pair). It simply pipes the stream into the writable side of the supplied pair, and returns the readable side for further use.
Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.
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.
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.
Injects the initial state for the executor that is created in the future.
The initial state of the hydrated executor that can be created via ExecutorManager.getOrCreate.
true
if the executor was hydrated, or false
if the executor already exists and 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 nextHydrationScript 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 nextHydrationScript 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.
Returns serializable executor manager state.
The streaming executor manager that can be used as a transformer for Web Streams. It enqueues executor hydration chunks into the after each chunk from the read side.