Skip to content

alwaysloseall/object-localstorage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

objectStorage

what can it do

Allow use setitems with field of object in localstorage

Getting Started

  • setItem:
/**
 * @param  {string} field "object.key"
 */
objectStorage.setItem(field: string, value: any);
// eg:
objectStorage.setItem('example.test', 'test');
  • getItem:
/**
 * @param  {string} field "object.key"
 */
objectStorage.getItem(field: string);
// eg:
objectStorage.setItem('example.test'); // 'test'
  • switch to sessionStorage
objectStorage.setType('session');
  • switch to LocalStorage
objectStorage.setType('local');
  • get current type
objectStorage.getType(); // 'local' or 'session'

About

able to setitems with field of object in localstorage

Resources

Stars

Watchers

Forks

Packages

No packages published