Home Reference Source Repository
import {Storage} from 'tablefilter/src/modules/storage.js'
public class | source

Storage

Stores the features state in browser's local storage or cookie

Constructor Summary

Public Constructor
public

constructor(state: State)

Creates an instance of Storage

Method Summary

Public Methods
public

Release Storage event subscriptions and clear fields

public

Returns the storage key

public

init()

Initializes the Storage object

public

remove()

Removes persisted state from storage

public

Turns stored string into a State JSON object

public

save(state: State)

Persists the features state on state changes

public

sync()

Applies persisted state to features

Public Constructors

public constructor(state: State) source

Creates an instance of Storage

Params:

NameTypeAttributeDescription
state State

Instance of State

Public Methods

public destroy() source

Release Storage event subscriptions and clear fields

public getKey(): String source

Returns the storage key

Return:

String

Key

public init() source

Initializes the Storage object

public remove() source

Removes persisted state from storage

public retrieve(): Object source

Turns stored string into a State JSON object

Return:

Object

JSON object

public save(state: State) source

Persists the features state on state changes

Params:

NameTypeAttributeDescription
state State

Instance of State

public sync() source

Applies persisted state to features