Hacker News new | ask | show | jobs
by staltz 3979 days ago
From what I've gathered throughout discussions[1], React has seen some experiments with RxJS Observables (or something inspired by Observables), but they want to avoid the learning curve associated with reactive programming, keeping React beginner-friendly.

MVI architecture[2] in Cycle.js is derived from thinking about UIs holistically, and realizing how the user is connected to the application. The user gives events to the application, flowing through a thick layer of abstraction: from hardware (mouse) to operating system, to browser, to DOM, then finally to your application. Intent in MVI is another layer of abstraction between those user events and the program's state. The key here is to realize what is the source/owner of events: the actual human user. I think it makes no sense to think about events as owned by view components, it doesn't match reality. PS: MVI arch can be done with React as well, you can e.g. use document.querySelector().addEventListener() globally and remove events from components. This is how Cycle.js just leverages DOM events (and custom DOM events too).

React has tougher challenges though, since they want to contain both DOM and Native and whatnot event systems in the same abstraction.

[1] https://twitter.com/sebmarkbage/status/589966228938063873

[2] http://cycle.js.org/model-view-intent.html

1 comments

Okay, that explains a lot. It is also ironic because React's rejection of FRP in its completeness has also spawned a very poor substitute they call Flux.

The number of Flux versions that have been churned out as a result is obscene. That is certainly not keeping it beginner-friendly, that is just leading developers astray.

While all the Flux activity may make it look like a lot is going on with React it has instead just wasted everyone's time and kept them from learning a key paradigm like FRP.

I'm not sure how Fiber Reinforced Plastic helps. Seriously, if you want to be understood, define acronyms.
If you want to walk on the wild side and get out of the framework cage and take a breath in fresh air then checkout the following:

https://github.com/channikhabra/yarr/blob/master/complete-tu...

Interesting to see what was meant to be the most glorious and final (to end all Flux wars) version of Flux get revamped with Rx:

https://github.com/jas-chen/rx-redux