# Storage | tablefilter v0.5.3 API Document

    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 | destroy () Release Storage event subscriptions and clear fields |
public | getKey (): String Returns the storage key |
public | init () Initializes the Storage object |
public | remove () Removes persisted state from storage |
public | retrieve (): Object 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:

Name | Type | Attribute | Description
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:

Name | Type | Attribute | Description
state | State |  | Instance of State

### public sync() source

Applies persisted state to features