Create an in-memory NAP-STORAGE persistence adapter.
Pass it as statePersistence in the shell adapter (or RuntimeAdapter); the runtime routes every storage.* request to it with identity-scoped keys and enforces the quota itself.
statePersistence
RuntimeAdapter
storage.*
Optional seed entries.
A StatePersistence with mock.state() and mock.reset().
StatePersistence
mock.state()
mock.reset()
const persistence = createMockStatePersistence({ seed: { 'napplet-state:feed:abc:theme': 'dark' },});persistence.keys('napplet-state:feed:abc:'); // ['napplet-state:feed:abc:theme'] Copy
const persistence = createMockStatePersistence({ seed: { 'napplet-state:feed:abc:theme': 'dark' },});persistence.keys('napplet-state:feed:abc:'); // ['napplet-state:feed:abc:theme']
Create an in-memory NAP-STORAGE persistence adapter.
Pass it as
statePersistencein the shell adapter (orRuntimeAdapter); the runtime routes everystorage.*request to it with identity-scoped keys and enforces the quota itself.