A functional and reactive JavaScript framework for cleaner code
main()
main()
is a pure, reactive dataflow
Libraries to manipulate Observables with operators
> Rx.js, xstream…
function main(sources) {
const decrement$ = sources.DOM
.select('.decrement').events('click').mapTo(-1);
const increment$ = sources.DOM
.select('.increment').events('click').mapTo(+1);
const action$ = xs.merge(decrement$, increment$);
const count$ = action$.fold((x, y) => x + y, 0);
const vtree$ = count$.map(count =>
div([
button('.decrement', 'Decrement'),
button('.increment', 'Increment'),
p('Counter: ' + count)
])
);
return { DOM: vtree$ };
}
YES if your team wants to learn FRP with JavaScript and is ready to get involved and contribute to the Cycle.js community.
Otherwise… nope, go for something else (Elm, Angular 2…)