@mocanvas/sync · interface
interface Transport<R extends UnknownRecord = UnknownRecord>A duplex channel that carries SyncMessages between peers in one room.
The transport owns serialization and reconnection; the client above it only
sees decoded messages. onOpen fires every time the channel becomes usable
(including after a reconnect), onClose every time it stops being usable.
A transport with neither is treated as open from the moment it is connected.
Methods · 3
close(): voidonMessage(callback: (message: SyncMessage<R>) => void): () => voidsend(message: SyncMessage<R>): voidProperties · 2
onClose?(callback: () => void): () => voidonOpen?(callback: () => void): () => voidMentioned here
mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.