Skip to main content
Version: 0.17

Class: LocalStorageBucket

Bucket for persisting transient data in localStorage.

Hierarchy​

  • Bucket

    ↳ LocalStorageBucket

Constructors​

constructor​

• new LocalStorageBucket(settings?)

Create a new LocalStorageBucket.

Parameters​

NameType
settingsLocalStorageBucketSettings

Overrides​

Bucket.constructor

Defined in​

local-storage-bucket/src/bucket.ts:19

Accessors​

delimiter​

• get delimiter(): string

Returns​

string

Defined in​

local-storage-bucket/src/bucket.ts:32


name​

• get name(): undefined | string

Name used for tracking and debugging a bucket instance.

Returns​

undefined | string

Inherited from​

Bucket.name

Defined in​

core/dist/modules/bucket.d.ts:63


namespace​

• get namespace(): string

The namespace used by the bucket when accessing any items.

This is used to distinguish one bucket's contents from another.

Returns​

string

Inherited from​

Bucket.namespace

Defined in​

core/dist/modules/bucket.d.ts:69


version​

• get version(): number

The current version of the bucket.

This is read-only. To change versions, upgrade should be invoked.

Returns​

number

Inherited from​

Bucket.version

Defined in​

core/dist/modules/bucket.d.ts:75

Methods​

clear​

â–¸ clear(): Promise<void>

Returns​

Promise<void>

Overrides​

Bucket.clear

Defined in​

local-storage-bucket/src/bucket.ts:59


emit​

â–¸ emit(event, ...args): void

Parameters​

NameType
eventEvent
...argsunknown[]

Returns​

void

Inherited from​

Bucket.emit

Defined in​

core/dist/modules/evented.d.ts:23


getFullKeyForItem​

â–¸ getFullKeyForItem(key): string

Parameters​

NameType
keystring

Returns​

string

Defined in​

local-storage-bucket/src/bucket.ts:36


getItem​

â–¸ getItem(key): Promise<unknown>

Parameters​

NameType
keystring

Returns​

Promise<unknown>

Overrides​

Bucket.getItem

Defined in​

local-storage-bucket/src/bucket.ts:40


listeners​

â–¸ listeners(event): Listener[]

Parameters​

NameType
eventEvent

Returns​

Listener[]

Inherited from​

Bucket.listeners

Defined in​

core/dist/modules/evented.d.ts:24


off​

â–¸ off(event, listener?): void

Parameters​

NameType
eventEvent
listener?Listener

Returns​

void

Inherited from​

Bucket.off

Defined in​

core/dist/modules/evented.d.ts:21


on​

â–¸ on(event, listener): () => void

Parameters​

NameType
eventEvent
listenerListener

Returns​

fn

â–¸ (): void

Returns​

void

Inherited from​

Bucket.on

Defined in​

core/dist/modules/evented.d.ts:20


one​

â–¸ one(event, listener): () => void

Parameters​

NameType
eventEvent
listenerListener

Returns​

fn

â–¸ (): void

Returns​

void

Inherited from​

Bucket.one

Defined in​

core/dist/modules/evented.d.ts:22


removeItem​

â–¸ removeItem(key): Promise<void>

Parameters​

NameType
keystring

Returns​

Promise<void>

Overrides​

Bucket.removeItem

Defined in​

local-storage-bucket/src/bucket.ts:53


setItem​

â–¸ setItem(key, value): Promise<void>

Parameters​

NameType
keystring
valueunknown

Returns​

Promise<void>

Overrides​

Bucket.setItem

Defined in​

local-storage-bucket/src/bucket.ts:47


upgrade​

â–¸ upgrade(settings?): Promise<void>

Upgrades Bucket to a new version with new settings.

Settings, beyond version, are bucket-specific.

Parameters​

NameType
settings?BucketSettings

Returns​

Promise<void>

Inherited from​

Bucket.upgrade

Defined in​

core/dist/modules/bucket.d.ts:81