obento-state
v1.0.1
Published
obent-state can manage internal state change like URL.
Downloads
5
Readme
obento-state
obent-state can manage internal state change like URL
Installation
Yarn:
yarn add obento-state
npm:
npm install --save obento-state
Example
var state = new require('obento-state')();
var fc = function() {
state.wait();
setTimeout(function() {
state.notify();
}, 1000);
}
state.listen('add:a', fc);
state.listen('add:b', function() {
// will call after 1 second from called fc()
});
state.change('/a/b');
// will call 'fc'