Skip to content
0

katanakit-js / createMemoryStorage

Function: createMemoryStorage() ​

ts
function createMemoryStorage(): Storage;

Defined in: src/infrastructure/storage/storage.service.ts:75

Creates a new in-memory Storage instance used as an SSR / private-mode fallback. Each call owns its own Map — never share one across requests.

Returns ​

Storage

An object conforming to the Web Storage API.

Example ​

ts
const mem = createMemoryStorage();
mem.setItem("key", JSON.stringify({ a: 1 }));

Released under the MIT License.