Class: LocalStorageBucket
Bucket for persisting transient data in localStorage.
Hierarchy​
Bucket
↳
LocalStorageBucket
Constructors​
constructor​
• new LocalStorageBucket(settings?
)
Create a new LocalStorageBucket.
Parameters​
Name | Type |
---|---|
settings | LocalStorageBucketSettings |
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​
Name | Type |
---|---|
event | Event |
...args | unknown [] |
Returns​
void
Inherited from​
Bucket.emit
Defined in​
core/dist/modules/evented.d.ts:23
getFullKeyForItem​
â–¸ getFullKeyForItem(key
): string
Parameters​
Name | Type |
---|---|
key | string |
Returns​
string
Defined in​
local-storage-bucket/src/bucket.ts:36
getItem​
â–¸ getItem(key
): Promise
<unknown
>
Parameters​
Name | Type |
---|---|
key | string |
Returns​
Promise
<unknown
>
Overrides​
Bucket.getItem
Defined in​
local-storage-bucket/src/bucket.ts:40
listeners​
â–¸ listeners(event
): Listener
[]
Parameters​
Name | Type |
---|---|
event | Event |
Returns​
Listener
[]
Inherited from​
Bucket.listeners
Defined in​
core/dist/modules/evented.d.ts:24
off​
â–¸ off(event
, listener?
): void
Parameters​
Name | Type |
---|---|
event | Event |
listener? | Listener |
Returns​
void
Inherited from​
Bucket.off
Defined in​
core/dist/modules/evented.d.ts:21
on​
â–¸ on(event
, listener
): () => void
Parameters​
Name | Type |
---|---|
event | Event |
listener | Listener |
Returns​
fn
â–¸ (): void
Returns​
void
Inherited from​
Bucket.on
Defined in​
core/dist/modules/evented.d.ts:20
one​
â–¸ one(event
, listener
): () => void
Parameters​
Name | Type |
---|---|
event | Event |
listener | Listener |
Returns​
fn
â–¸ (): void
Returns​
void
Inherited from​
Bucket.one
Defined in​
core/dist/modules/evented.d.ts:22
removeItem​
â–¸ removeItem(key
): Promise
<void
>
Parameters​
Name | Type |
---|---|
key | string |
Returns​
Promise
<void
>
Overrides​
Bucket.removeItem
Defined in​
local-storage-bucket/src/bucket.ts:53
setItem​
â–¸ setItem(key
, value
): Promise
<void
>
Parameters​
Name | Type |
---|---|
key | string |
value | unknown |
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​
Name | Type |
---|---|
settings? | BucketSettings |
Returns​
Promise
<void
>
Inherited from​
Bucket.upgrade
Defined in​
core/dist/modules/bucket.d.ts:81