[!!!] The source code of this package is on https://github.com/docomodigital/js-utils, this repository will be removed asap
Storage is the library to save and get data in different ways.
import Storage from '@docomodigital/js-storage';
// Set an item in the storage
Storage.set('locale', 'en');
// Get a previously setted item from the storage
Storage.get('locale'); // 'en'
// Delete an item from the storage if present
Storage.delete('locale');
// Switch to another Storage (window.localStorage), default is cookie
Storage.setStorage('localstorage');
npm install --save @docomodigital/js-storage
To read documentation, go to:
http://docomodigital.github.io/js-storage/latest
or run the following command inside the js-storage folder:
npm run doc:open