createMemoryStorage
function createMemoryStorage(options?): MemoryEntitlementsStorage;Defined in: src/storage/memory.ts:33
Create an in-memory storage implementing both watch (callbacks fire on the
next microtask after a write/remove) and compareAndSwap (structural
equality; race-free in-process).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options? |
MemoryStorageOptions |
Returns
Section titled “Returns”Example
Section titled “Example”import { createMemoryStorage } from "@xtandard/entitlements/storage/memory";
const storage = createMemoryStorage();// Optionally seed with pre-existing data:// const storage = createMemoryStorage({ initial: { "my-key": { value: 1 } } });