@mocanvas/editor · function

createPresenceStateDerivation

declare function createPresenceStateDerivation<U extends PresenceUser>($user: Signal<U>, options?: PresenceStateDerivationOptions): (store: EditorStore) => Signal<InstancePresence | null>

Build the signal that says what to broadcast about this client.

Curried the way a sync layer wants it: bind the identity once, then apply it to a store to get a derived instance_presence record that recomputes whenever the camera moves, the selection changes, the brush is dragged or the current page changes. Push its value at whatever rate the transport likes — the signal itself does no scheduling.

Returns null before the store has an instance record, i.e. before the editor has finished starting up.

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.