Home Reference Source Test
import Storage from 'storage-keeper/src/Storage.js'
public class | source

Storage

Direct Subclass:

LocalStorage, SessionStorage

Constructor Summary

Public Constructor
public

constructor(prefix: *, storeAdapter: *)

Member Summary

Public Members
public

Storage key prefix

public

storeAdapter: Adapter

Adapter for storing and getting values

Method Summary

Public Methods
public

get(key: string): union

Get value from storage.

public

remove(key: string)

Remove item from storage.

public

set(key: string, value: union, expire: nullable): void

Set new item to storage.

Private Methods
private

_parseEncodedValue(object: union, key: string): union

Parse object saved in storage.

Public Constructors

public constructor(prefix: *, storeAdapter: *) source

Params:

NameTypeAttributeDescription
prefix *

Storage key prefix

storeAdapter *

Adapter for storing and getting values

Public Members

public prefix: string source

Storage key prefix

public storeAdapter: Adapter source

Adapter for storing and getting values

Public Methods

public get(key: string): union source

Get value from storage.

Params:

NameTypeAttributeDescription
key string

storage key

Return:

union

content of storage

public remove(key: string) source

Remove item from storage.

Params:

NameTypeAttributeDescription
key string

key to remove

public set(key: string, value: union, expire: nullable): void source

Set new item to storage.

Params:

NameTypeAttributeDescription
key string

key of item

value union

value of item

expire nullable

date of expire

Return:

void

Private Methods

private _parseEncodedValue(object: union, key: string): union source

Parse object saved in storage.

Params:

NameTypeAttributeDescription
object union

Save object

key string

Key of item

Return:

union

Decoded value