@mocanvas/store · function

createInMemoryStorage

declare function createInMemoryStorage<R extends UnknownRecord = UnknownRecord>(): SynchronousStorage<R>

A SynchronousStorage backed by a plain Map.

Useful in tests and as the reference implementation of the contract — the shortest correct answer to "what does a storage have to do?".

Mentioned 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.