3 ms·
Observables
- mdtusz 11y agoI've never seen Cycle before, but this looks somewhat similar to Mithril (http://lhorie.github.io/mithril/index.html http://lhorie.github.io/mithril/index.html), which is based on a semi-FRP virtual-dom approach. The thing that I prefer about Mithril though is that at the end of the day, your code looks like regular, vanilla js and is extremely readable. It's a pretty much invisible framework that you can use however you see the best fit - it just takes care of rendering and updating without any magic, and provides you with some helpful tools for managing models. My immediate grip with Cycle is the api - it just looks messy and more complex than it needs to be.
- staltz 11y agoHow do you see the API as messy and complex? It is just `run()` and `DOM.get(selector, eventType)`.
- mrspeaker 11y agoI'm not sure what mdtusz means, but my very initial initial reaction (and this is a very superficial syntax-level look - which of course has very little real value) is that it feels like it less "idiomatic JavaScript" and more like reading Java. Perhaps that's what the parent felt too, but like I said - that's a cursory glance not thinking about the concepts at all. I have Cycle on my radar and am keen to have a deeper play... I will say this though, I am loving all the developments in this space recently!
- staltz 11y ago"Reading like Java" is the last comment I would expect to hear. There aren't even classes in Cycle.js apps, mainly functions and Observables. Anyway, waiting for some informed feedback as opposed to immediate gripes.
- skeeterbug 11y agoHow is this anything like reading Java? Are you sure you looked at the correct examples? Is it because of "main" and the ES6 imports at the top? This comment is truly baffling to me.
- skeeterbug 11y agohttp://cycle.js.org/documentation.html http://cycle.js.org/documentation.html 5 documented functions, and one documented property. This is probably one of the most minimal/clean API's I have seen.
- gkya 11y agoI'm really alien to the concept and to the library itself, but still minimal/clean ≠ not complex Like monads, this is rather abstract, although simple. As abstractions accumulate in layers, the thing becomes harder to understand.
- nickkell 11y agoI think working with Rx and these streams in general takes getting used to, but it's such a useful concept to learn for its own sake.
- dreamdu5t 11y agoMessy and complex? The entire lib consists of a couple of functions. All it does is hook observables together.
- findjashua 11y agojust looked at mithril, didn't see any observables, so I'm not sure if it's FRP. My favorite thing about Cyclejs is the use of observables instead of setters. I usually dislike setter methods, since it becomes hard to track all the places that modify the state. With observables, the streams being combined/merged give you that information instantly. Observables also give you very fine grained control over the data, so you don't need lifecycle hooks to control v-dom rendering (just use throttle/debounce). That said, the concept of drivers is new and can seem kinda wonky at first, but 'give it 5 minutes'?