
Plug and Play All Your Observable Streams With Cycle.js - staltz
https://medium.com/@fkrautwald/plug-and-play-all-your-observable-streams-with-cycle-js-e543fc287872
======
noelwelsh
Holy hyperbole, Batman! That article took a long time to get to the point, and
I'm a touch hesitant to use the same breathless tone as the author. As I
understand it, the model is the same as Elm. Separating specifying the
computation (in this case, defining the event processing graph) from running
the computation is an old trick in FP circles[1]. It's great to see JS
libraries moving forward, but it would sure be an easier read if the author
dropped the embellishment.

[1] Blog post about this: [http://underscore.io/blog/posts/2015/04/28/monadic-
io-lazine...](http://underscore.io/blog/posts/2015/04/28/monadic-io-laziness-
makes-you-free.html)

------
bryanrasmussen
Cycle.js [http://cycle.js.org/](http://cycle.js.org/) says that it allows
"thisless JavaScript: The use of functions and RxJS Observables allow for a
JavaScript programming style without the this keyword. Cycle.js encourages you
to create apps with functional practices. Without this, you can write more
reusable code and define logic without tightly coupling it to data. See it for
yourself, this cannot be found in Cycle.js TodoMVC."

this, uh, doesn't seem to match my normal understanding of JS. Normally the
method to reuse code is to change what 'this' refers to, but the statement
above implies the existence of 'this' is a failure of JavaScript's design. I
would like some elaboration.

~~~
tobr
If you want to adopt a functional style, then there is little benefit to using
`this` instead of regular arguments or closures, which are more versatile and
follow more straightforward rules. I think most JS developers have been
confused over the value of `this` more than once.

~~~
bryanrasmussen
I would think call and apply would be useful for a functional style, but no?

~~~
RobertKerans
YMMV, but I thought I would use them more regularly the more I wrote my JS in
a functional style, but the use cases started to steadily dry up; it's gets
much easier to write code that simply doesn't need to hold the reference in
that way. Arrow functions help a great deal (there is no concept of `this`
within them). Still very useful, but in very specific cases, or abstracted off
into helpers. I've found `bind()` is much more useful (and will become moreso
if the bind operator is okayed and optimised).

------
cmdv
I've been playing with Cycle.js and was struggling a little even though I have
previous experience in RxJS but after going through this article it really
cleared up some fundamental aspects to Cycle.js :)

~~~
RobertKerans
The PragProg book they just released uses RXJS && Cycle.JS: I'm about halfway
though at the minute, it's been really good so far, and I'd recommend it if
you're wanting a bit more detail.

------
Maarten88
> This embedded content is from a site that does not comply with the Do Not
> Track (DNT) setting now enabled on your browser.

Never seen that before; +1 for medium.com

~~~
omphalos
Now if only they would stop requiring JavaScript to see images :)

