Core · class
BrowserStore
localStorage, with every access guarded.
Explained in The loop.
class BrowserStore implements KeyValueStoreimport { BrowserStore } from '@driftengine/core';In depth
A blocked store degrades to memory rather than to nothing: settings then last the session instead of resetting between screens, and a first-run prompt fires once per visit instead of on every single load. Never showing it at all would be the worse failure — a player who arrived from a link would have no idea what the controls are.
Constructor
new
constructor()Methods
read
read(key: string): string | null| Parameter | Type | Description |
|---|---|---|
key | string |
write
write(key: string, value: string): void| Parameter | Type | Description |
|---|---|---|
key | string | |
value | string |
remove
remove(key: string): void| Parameter | Type | Description |
|---|---|---|
key | string |