universal-storage-adapter
v1.1.3
Published
This package give us ability not to think about what kind of storage is supported for browser. It uses one of three most popular storages (local, cookie, session);
Downloads
4
Maintainers
Readme
Usage: You need to import package in this way : import storageAdapter from 'uiversal-storage-adapter'; Then use set and get methods to get or set some information from storage in this way: storageAdapter.get({ key: 'some key' })); storageAdapter.set({ key: 'some key', data: { value: 'some value', expires:200 }})
key: should be a string or a positive number data: should be an object with required fields 'value' and 'expires'. Expires param should be a positive number, it give us information about how many seconds will "live" data in storage;
Sorry for my english, thanx!