Protected_ctxProtected_lifecycleThe connection to the services provider was terminated. This should fire if the services disconnect unexpectedly or during a client reset.
The underlying service connection was re-established. Fires after all reconnection callbacks have completed.
Effect-native client for all client services, inferred from the effect-rpc definitions.
Preferred surface for new consumers; must be re-read after reconnect rather than cached.
Effects it produces require only the default runtime and can be run with any Runtime<never>.
Protected_catchError handler for errors that are caught by the context. By default, errors are bubbled up to the parent context which is passed to the open method.
To be overridden by subclasses.
To be overridden by subclasses.
await using resource = new Resource();
await resource.open();
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/using
Closes the resource. If the resource is already closed, it does nothing.
Optionalctx: ContextOpens the resource. If the resource is already open, it does nothing. If the resource is in an error state, it throws an error. If the resource is closed, it waits for it to close and then opens it.
Optionalctx: ContextContext to use for opening the resource. This context will receive errors that are not handled in _catch.
Calls the provided function, opening and closing the resource.
NOTE: Consider using using instead.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/using
Waits until the resource is open.
Runs services in a dedicated worker, exposed to other tabs. Leader election is used to ensure only a single worker is running.