HashStorage
a hash storage in typescript that behave like localstorage
Installation
via nodejs
npm install --save hashstorage
Types of store
- StorageJson : as a JSON string
- Storage64 : json encoded64 string
- StorageParams : as a list of key=param
Imports
Scripts
<script src="node_modules/hashstorage/dist/bundles/hashstorage.umd.min.js"></script><script> var storage = ;</script>
Require
var hashstorage = ;var storage = ;
Import
;var storage = ;
Usage
//set an item with a key, if the item already exist overwrite itstorage; //get value of an item, if the item does not exist return nullvar value = storage; //remove an item with a key, if the item does not exist do nothingstorage; //clear the storagestorageclear; //listen to the event of the hash change//if you listen to window.addEventListener("hashchange", function () { ... }); the value will not be yet parsedstoragehashChanged;