1.1.1 • Published 7 years ago

simobs v1.1.1

Weekly downloads
3
License
ISC
Repository
github
Last release
7 years ago

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

1.1.1

7 years ago

1.1.0

7 years ago

1.0.1

7 years ago