Class WebxdcProvider

Source
Expand description

Webxdc integration with yjs.

Constructors§

Source§

new WebxdcProvider(__namedParameters: WebxdcProviderOptions): WebxdcProvider

Methods§

Source§

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 update listener, we instead set a destroyed flag to ignore future updates.

Source§

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

Register a handler that gets fired whenever a yjs change is detected.

Source§

syncToChatPeers(): void

Explicitly sync the chat to peers.

Normally this is called automatically by the autosave mechanism, so you do not need to call this manually.