Skip to content

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

Parameter Type
options? MemoryStorageOptions

MemoryEntitlementsStorage

import { createMemoryStorage } from "@xtandard/entitlements/storage/memory";
const storage = createMemoryStorage();
// Optionally seed with pre-existing data:
// const storage = createMemoryStorage({ initial: { "my-key": { value: 1 } } });