Skip to content

Scoped Storage Api

ScopedApi.storage

Methods

deleteValue()

deleteValue(key): void

Removes a value which has been saved

Parameters

ParameterType
keystring

Returns

void


getValue()

getValue(key, defaultValue?): any

Gets a value that has previously been saved

Parameters

ParameterType
keystring
defaultValue?any

Returns

any


onChange()

onChange(key, callback): () => void

Adds a listener for when a stored value with a certain key changes

Parameters

ParameterType
keystring
callback(value, remote) => void

Returns

Function

Returns

void


setValue()

setValue(key, value): void

Sets a value which can be retrieved later, persisting through reloads

Parameters

ParameterType
keystring
valueany

Returns

void