Skip to content

The object storage with asynchronous observing the stored object changes.

Notifications You must be signed in to change notification settings

sinires/Observe-storage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Observe-storage

The object storage with asynchronous observing the stored object changes.

Install

<script type="text/javascript" src="/src/ObserveStorage.js"></script>

Usage

Adding object to the storage

    let wrapper = ObserveStorage.add(key, object); //return Proxy
//or
    let wrapper = ObserveStorage.add(object); //return Proxy

Extract object from the storage

let wrapper = ObserveStorage.get(key); //return Proxy

Removing object from the storage

ObserveStorage.remove(key); //return boolean

Subscribing to the object changes

Subscribing to all the fields
  const subId = wrapper.on(callback); //return subscribe id
Subscribing to a specific field
  const subId = wrapper.on(callback, field); //return subscribe id

Unsubscribing from the object changes

  wrapper.un(subId); //return Proxy

License

This work is licensed under a Creative Commons Attribution 3.0 Unported License.

About

The object storage with asynchronous observing the stored object changes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published