persisted-object

0.0.1 • Public • Published
    .---.            _       .-.         .-. .--. .-.    _             .-. 
    : .; :          :_;     .' `.        : :: ,. :: :   :_;           .' `.
    :  _.'.--. .--. .-. .--.`. .'.--.  .-' :: :: :: `-. .-. .--.  .--.`. .'
    : :  ' '_.': ..': :`._-.': :' '_.'' .; :: :; :' .; :: :' '_.''  ..': : 
    :_;  `.__.':_;  :_;`.__.':_;`.__.'`.__.'`.__.'`.__.': :`.__.'`.__.':_; 
                                                      .-. :                
                                                      `._.'    

Use it just like a regular javascript object.

var PersistedObject = require('persisted-object');
var foo = new PersistedObject('uniq-foo-key');
 
if (foo.bar) {
  console.log('Bar is: ', foo.bar);
} else {
  console.log('Setting bar!!!');
  foo.bar = 'baz';
}

When you first load this script, it will say Setting bar!!! in the console.

Reload the page and it will say Bar is: baz.

Install it with npm:

npm install persisted-object

or bower:

bower install persisted-object

See the list of supported browsers.

Readme

Keywords

none

Package Sidebar

Install

npm i persisted-object

Weekly Downloads

1

Version

0.0.1

License

none

Last publish

Collaborators

  • brysgo1