1.1.1 • Published 7 years ago
simobs v1.1.1
simobs
Simple observer with less than 2 ** 4
lines of code.
Install
$ npm i -s simobs
Usage
import Simobs from 'simobs'
let obs = new Simobs
// Subscribe.
obs.sub(() => 42)
// Push states.
obs.v({1: 1})
// Push an unchanged state.
obs.v({1: 1})
// => undefined
// Push a new state.
obs.v({1: 2})
// => 42
// No deepdiff (diffing with `===' only).
obs.v(420, false)
License
ISC