Documentation
    Preparing search index...

    Function createMockStatePersistence

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

      Parameters

      Returns MockStatePersistence

      A StatePersistence with mock.state() and mock.reset().

      const persistence = createMockStatePersistence({
      seed: { 'napplet-state:feed:abc:theme': 'dark' },
      });
      persistence.keys('napplet-state:feed:abc:'); // ['napplet-state:feed:abc:theme']