gc-storage

1.0.2 • Public • Published

gc-storage

this object is a singleton that you can store and get data any scope you imported

 
import eventInstance from 'gc-storage'
// import eventInstance from 'gc-storage/es5' //import as es5
 
storage.set('data',{data:'data'})
 
storage.watch('data',(val)=>{
    console.log(`watch on data, value changed to ${val}`)
})
 
storage.set('data',{data:'data changed'})
 
storage.unWatch('data')
 
storage.set('data','modify data to string')
 
console.log(storage.get('data'))
 
storage.clean()
 
console.log(storage.get('data'))
 

Readme

Keywords

Package Sidebar

Install

npm i gc-storage

Weekly Downloads

0

Version

1.0.2

License

ISC

Unpacked Size

4.71 kB

Total Files

7

Last publish

Collaborators

  • zhaochunzheng