@mocanvas/sync · function

createMemoryTransportPair

declare function createMemoryTransportPair<R extends UnknownRecord = UnknownRecord>(): [Transport<R>, Transport<R>]

Two transports wired to each other, going through the same JSON encode and decode as the real ones. Delivery is asynchronous (a microtask) so that a peer never observes a message inside its own send() call stack.

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.