Cycle.js – A functional and reactive JavaScript framework for predictable code
1–10 of 64 posts
Re: Cycle.js – A functional and reactive JavaScript framework for predictable code
#2- Dynamic lists of components are really annoying to create. In Cycle, the happy path is calling every component function in your app at startup to set up the data flow graph, and then your reactive operators handle the actual logic. With dynamically added or removed components, you get a stream of "sinks" and then have to splice them into your data flow somehow.
- Circular dependencies are cumbersome. If a parent passes a value to a child which can change that value in the parent, you essentially have to create a stub stream in the parent, use it to derive the parent's state and then "imitate" the output of the child as well.
That said, Cycle has a lot of great ideas that I want to become more mainstream. If you have a free weekend, try it! The creator André Staltz's blog is also a good read: https://staltz.com/
Re: Cycle.js – A functional and reactive JavaScript framework for predictable code
#3Re: Cycle.js – A functional and reactive JavaScript framework for predictable code
#4Re: Cycle.js – A functional and reactive JavaScript framework for predictable code
#5The code looks a bit messy to be honest, maybe it's just the variable naming. `const input$ = sources.DOM.select('.field').events('input')` Why not name it the same as the DOM function `querySelector` ? `const name$ = input$.map(ev => ev.target.value).startWith('')` Wouldn't in this case `name$` be a boolean, but then `map` is called on a boolean. I just find the syntax very confusing.
Re: Cycle.js – A functional and reactive JavaScript framework for predictable code
#6The code looks a bit messy to be honest, maybe it's just the variable naming. `const input$ = sources.DOM.select('.field').events('input')` Why not name it the same as the DOM function `querySelector` ? `const name$ = input$.map(ev => ev.target.value).startWith('')` Wouldn't in this case `name$` be a boolean, but then `map` is called on a boolean. I just find the syntax very confusing.
Re: Cycle.js – A functional and reactive JavaScript framework for predictable code
#7The code looks a bit messy to be honest, maybe it's just the variable naming. `const input$ = sources.DOM.select('.field').events('input')` Why not name it the same as the DOM function `querySelector` ? `const name$ = input$.map(ev => ev.target.value).startWith('')` Wouldn't in this case `name$` be a boolean, but then `map` is called on a boolean. I just find the syntax very confusing.
What makes you guess that `name$` is a boolean?
Re: Cycle.js – A functional and reactive JavaScript framework for predictable code
#8The code looks a bit messy to be honest, maybe it's just the variable naming. `const input$ = sources.DOM.select('.field').events('input')` Why not name it the same as the DOM function `querySelector` ? `const name$ = input$.map(ev => ev.target.value).startWith('')` Wouldn't in this case `name$` be a boolean, but then `map` is called on a boolean. I just find the syntax very confusing.
Reactive programming is a paradigm shift and definitely tough to wrap your head around at first. André Staltz (the creator of Cycle) has a good intro here: https://gist.github.com/staltz/868e7e9bc2a7b8c1f754
Re: Cycle.js – A functional and reactive JavaScript framework for predictable code
#9Re: Cycle.js – A functional and reactive JavaScript framework for predictable code
#10Man, I should start pasting my bookmarks on HN - that will give major boost to my HN score.