In-memory implementation of IStorage.
Useful for testing or for sessions that should not persist across page reloads.
new MemoryStorage():MemoryStorage
MemoryStorage
getItem(key:string):Promise<string|null>
Retrieves the value associated with the given key.
| Parameter | Type | Description |
|---|---|---|
key | string | The unique identifier for the stored item. |
Promise<string | null>
The stored value as a string, or null if the key does not exist.
removeItem(key:string):Promise<void>
Removes the item associated with the specified key from storage.
| Parameter | Type | Description |
|---|---|---|
key | string | The unique identifier of the item to remove. |
Promise<void>
setItem(key:string,value:string):Promise<void>
Stores a key-value pair in the storage.
| Parameter | Type | Description |
|---|---|---|
key | string | The unique identifier for the item. |
value | string | The string value to store. |
Promise<void>