presentation-storage v2.5.7
presentation-storage
Augmented.js Presentation Storage Module
API
Table of Contents
LocalStorage
Local Storage API - returned from LocalStorageFactory
Parameters
persistboolean Persistant storage or not
isSupported
is Persistant or not
Properties
isPersistedboolean Persistant property
isSupported
Is storage supported
Returns boolean Returns true if supported
getItem
Gets an item from storage
Parameters
itemKeykeystring The key in storage
Returns object Returns object from storage
setItem
Sets an item to storage
Parameters
removeItem
Removes an item from storage
Parameters
itemKeykeystring The key in storage
clear
Clears storage - Warning: Destructive in non-namespaced instances!
key
Gets the key from storage for index
Parameters
inumber 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
persistboolean Persistance or notnamespacestring 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
persistnamespace
isSupported
Is storage supported
Returns boolean Returns true if supported
getItem
Gets an item from storage
Parameters
itemKeykeystring The key in storage
Returns object Returns object from storage
setItem
Sets an item to storage
Parameters
removeItem
Removes an item from storage
Parameters
itemKeykeystring The key in storage
clear
Clears storage for namespace
key
Gets the key from storage for index
Parameters
inumber 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