DEV Community

artydev
artydev

Posted on

Flyd a functional reactive library...

In my previous post I said Kefir is lighter than RxJS.

Flyd is lighter than Kefir, perhaps will it fits your needs.

Here is a simple counter in Flyd : FlydCounter

var clicks = flyd.stream();

inc.addEventListener('click', () => clicks(1));
dec.addEventListener('click', () => clicks(-1));

const sum = flyd.scan((x,y) => x + y, 0, clicks)

sum.map((v) => result.innerText = v)
Enter fullscreen mode Exit fullscreen mode

Top comments (0)