Expand description
Constructors§
Source§new WebxdcProvider<I extends Item = UpdateItem>(
__namedParameters: WebxdcProviderOptions<I>,
): WebxdcProvider<I>
new WebxdcProvider<I extends Item = UpdateItem>(
__namedParameters: WebxdcProviderOptions<I>,
): WebxdcProvider<I>
Properties§
§
readonly awareness: AwarenessThe awareness instance for ephemeral state (cursors, presence).
Methods§
Source§destroy(): void
destroy(): void
Release the resources held by the provider.
Call this when the provider is no longer needed, particularly in tests.
Since the webxdc API does not provide a way to unregister the webxdc update listener, we instead set a destroyed flag to ignore future webxdc updates.
Source§onSaved(handler: () => void): void
onSaved(handler: () => void): void
Register a handler that gets fired whenever local changes are saved.
This means they are broadcast to chat peers.
Source§onUpdated(handler: () => void): void
onUpdated(handler: () => void): void
Register a handler that gets fired whenever a yjs change is detected.
Webxdc integration with yjs.
The provider lets you manage state as yjs objects and have the provider propagate these state changes to other instances of the same app over the Webxdc network.