Skip to content

Interface: StorageInstance ​

Defined in: storage/create-storage.ts:82

Adds a prefix, subscriptions and error handling to an adapter. A write that changes nothing notifies nobody.

Properties ​

PropertyModifierTypeDescriptionDefined in
clearpublic(options?) => voidRemoves every key of this instance, except the ones in except.storage/create-storage.ts:96
destroypublic() => voidStops listening to changes made outside the instance, and drops every subscription.storage/create-storage.ts:106
getItempublic(key) => string | nullReturns the raw string under the key, without a parser.storage/create-storage.ts:87
haspublic(key) => boolean-storage/create-storage.ts:92
keyspublic() => string[]Returns the keys of this instance, without the prefix.storage/create-storage.ts:94
namereadonlystring'local', 'session', 'memory', or the name given to createStorage.storage/create-storage.ts:84
prefixreadonlystring-storage/create-storage.ts:85
removeItempublic(key) => voidRemoves the entry and notifies the listeners of the key.storage/create-storage.ts:91
setItempublic(key, value) => voidWrites a raw string and notifies the listeners of the key.storage/create-storage.ts:89
subscribepublic{ (key, listener): Unsubscribe; (listener): Unsubscribe; }Calls the listener when the key changes, or on every change when given only a listener. Returns the function that stops it.storage/create-storage.ts:101

Released under the MIT License.