npm.io
0.1.0 • Published 8 years ago

projective

Licence
MIT
Version
0.1.0
Deps
0
Vulns
0
Weekly
0
Stars
15
DeprecatedThis package is deprecated

projective

projective: a tiny library for pure, reactive and composable state.

The gist

import { Ref } from 'projective'

const increment = x => x + 1
const decrement = x => x - 1

const ref = Ref.root({left: 0, right: 0})

ref.on(x => console.log(x))

ref.proj('left').modify(increment)
ref.proj('right').modify(increment)
ref.proj('left').modify(decrement)

That's it!

Keywords