@mocanvas/editor · type

TLStoreWithStatus

type TLStoreWithStatus = 
/** No synchronisation is involved; the store is purely local and ready. */
{
    readonly status: "not-synced";
    readonly store: EditorStore;
}

A store, or the reason there isn't one yet.

A store that has to be fetched, migrated or synced before it can be shown is not just "a store that is empty" — an editor mounted on an empty store lets somebody start drawing into a document that is about to be replaced. So the store is only present in the states where it is genuinely ready, and the union makes it impossible to read one out of a state where it is not.

synced-remote carries a connection status of its own because being offline is not an error: the document is complete and editable, the edits are simply queued.

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.