simobs

1.1.1 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i simobs

Weekly Downloads

1

Version

1.1.1

License

ISC

Last publish

Collaborators

  • anqurvanillapy