Skip to content

LocalStoragePreferenceStore

class

Back to Helios Web API

Kind
class
Source
src/persistence/storage.js:18

Description

Preference store backed by the browser localStorage API.

Signature

export class LocalStoragePreferenceStore {

Parameters

NameTypeAttributesDefaultDescription
optionsObjectoptionalOptional storage object, preference key, and unfinished-session key.

Returns

Async preference store implementation.

Type LocalStoragePreferenceStore

Notes

Inject storage for tests or app shells that need isolated storage.

Configuration

General configuration setters and compatibility helpers.

clear() → {this}

Source: src/persistence/storage.js:42

Updates the clear state on the current instance.

Returns

This instance.

Type this

getUnfinishedSessionId(workspaceId = null, options = {})

Source: src/persistence/storage.js:46

Returns the current unfinished session id value or state.

Parameters

NameTypeAttributesDefaultDescription
workspaceIdoptionalnullValue passed to getUnfinishedSessionId.
optionsObjectoptional{}Options object for this operation.

setUnfinishedSessionId(id, workspaceId = null) → {this}

Source: src/persistence/storage.js:57

Set the unfinished session id setting.

Parameters

NameTypeAttributesDefaultDescription
idValue passed to setUnfinishedSessionId.
workspaceIdoptionalnullValue passed to setUnfinishedSessionId.

Returns

This instance.

Type this

Utilities

Additional public helpers that do not belong to a narrower API area.

unfinishedSessionKeyFor(workspaceId = null)

Source: src/persistence/storage.js:25

Configures or reads unfinished session key for.

Parameters

NameTypeAttributesDefaultDescription
workspaceIdoptionalnullValue passed to unfinishedSessionKeyFor.

read()

Source: src/persistence/storage.js:30

Configures or reads read.

write(value) → {Object|this}

Source: src/persistence/storage.js:36

Read or set the write setting.

Parameters

NameTypeAttributesDefaultDescription
valueNew write value. Omit this argument to read the current value.

Returns

Current write value when called without arguments; otherwise this instance for chaining.

Type Object|this

Example


helios.write(1);