presentation-storage

2.5.7 • Public • Published

presentation-storage

Augmented.js Presentation Storage Module

API

Table of Contents

LocalStorage

Local Storage API - returned from LocalStorageFactory

Parameters

  • persist boolean Persistant storage or not

isSupported

is Persistant or not

Properties

  • isPersisted boolean Persistant property

isSupported

Is storage supported

Returns boolean Returns true if supported

getItem

Gets an item from storage

Parameters

  • itemKey
  • key string The key in storage

Returns object Returns object from storage

setItem

Sets an item to storage

Parameters

  • itemKey
  • object object The data to set
  • key string The key in storage

removeItem

Removes an item from storage

Parameters

  • itemKey
  • key string The key in storage

clear

Clears storage - Warning: Destructive in non-namespaced instances!

key

Gets the key from storage for index

Parameters

  • i number The index in storage

Returns string Returns the key from storage

length

The length of storage by keys

Returns number Returns the length of storage by keys

LocalStorageFactory

LocalStorageFactory Retrieve a local storage Object

getStorage

Get the storage instance

Parameters

  • persist boolean Persistance or not
  • namespace string The namespace of the storage if needed (optional)

Returns LocalStorage Returns an instance of local storage

NamespacedLocalStorage

Extends LocalStorage

NamespacedLocalStorage Retrieve a local storage Object

Parameters

  • persist
  • namespace

isSupported

Is storage supported

Returns boolean Returns true if supported

getItem

Gets an item from storage

Parameters

  • itemKey
  • key string The key in storage

Returns object Returns object from storage

setItem

Sets an item to storage

Parameters

  • itemKey
  • object object The data to set
  • key string The key in storage

removeItem

Removes an item from storage

Parameters

  • itemKey
  • key string The key in storage

clear

Clears storage for namespace

key

Gets the key from storage for index

Parameters

  • i number The index in storage

Returns string Returns the key from storage

length

The length of storage by keys

Returns number Returns the length of storage by keys

getNamespacedItems

Gets the namespaced items as a Map

Returns AugmentedMap Returns the namespaced storage as Map

Dependents (4)

Package Sidebar

Install

npm i presentation-storage

Weekly Downloads

21

Version

2.5.7

License

Apache-2.0

Unpacked Size

893 kB

Total Files

46

Last publish

Collaborators

  • thedocbwarren