Necessarily Precedes Mischief
    Have ideas to improve npm?Join in the discussion! »

    This package has been deprecated

    Author message:

    Project merged into package snabbis

    projective
    TypeScript icon, indicating that this package has built-in type declarations

    0.1.0 • Public • Published

    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!

    Install

    npm i projective

    DownloadsWeekly Downloads

    2

    Version

    0.1.0

    License

    MIT

    Last publish

    Collaborators

    • avatar