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

0.4.2 • Public • Published

REVEjs: Leve lib for reactive programing

What is Revejs?

Revejs is leve (Brazilian Portuguese word for "light") reactive library with API base on react hooks and solid-js.

Goal

Goal of Revejs is to be light and make reactive programing easy to use for beginners.
Revejs doesn't intend to compete with RXJS or other reactive libraries.

Installation

npm i revejs

Usage

Base of Revejs is signals like in solid-js and react state

const [getter, setter] = createSignal('init value');

Getters and setter is functions, so value can be access like this

console.log(getter())

And values set like this

setter('new value')

Reactive part of revejs are effects. They're just the functions that are called when setter is running

createEffect(
    () => console.log('it run on value change'), 
    [getter, anotherGetter]
)

Effect can be nested

createEffect(() => {
  createEffect(() => console.log(''), [getter])
}, [getter])

Dependencies (0)

    Dev Dependencies (10)

    Package Sidebar

    Install

    npm i revejs

    Weekly Downloads

    1

    Version

    0.4.2

    License

    MIT

    Unpacked Size

    327 kB

    Total Files

    91

    Last publish

    Collaborators

    • untellson