Could it be your new unconventional love?
From the site:
Cycle’s core abstraction is your application as a pure function
main()where inputs are read effects (sources) from the external world and outputs (sinks) are write effects to affect the external world. These I/O effects in the external world are managed by drivers: plugins that handle DOM effects, HTTP effects, etc.
The internals of
main()are built using Reactive Programming primitives, which maximizes separation of concerns and provides a fully declarative way of organizing your code. The dataflow is plainly visible in the code, making it readable and traceable.
Of course, mentioning the concept of “reactive programming” immediately means it must be compared against React, right? The two are conceptually similar. Previously, Cycle.js’ creator has been openly critical of React. However in July 2018 he posted a blog titled “Use React in Cycle.js and vice-versa“. The two are not direct competitors. You can use React components and libraries in Cycle.js apps and benefit from the best of both. Cycle.js, for instance, is more for architecture.
Cycle.js promises to create small, readable code, since it only has a few key concepts. Functional reactive streams allow for building more with less.
Go on and test out the live preview.
Time to shift away from its positives for just a bit. As with learning any new framework, you might encounter some bumps in the road when using Cycle.js.
Quite frankly, it’s not that easy to grasp. Especially compared to building an app in React, using Cycle.js can take longer. (Of course, this is a subjective opinion and individual results may differ. We would love to hear from your own experiences.)
For those interested in learning more about reactive programming, Cycle.js is worth at least playing around in. It may shed some light on concepts and help formally introduce you to event streams and observables.
Some issues that users experienced have been addressed in Cycle State. This utility “wraps your Cycle.js main function with reducer-driven state management and a single state atom”.
Several tutorials can help you prepare to take off the training wheels:
- Cycle.js recommends André Staltz’s video lessons. (Staltz should be your first stop for information, since he is the author of Cycle.js. Why not learn from the person who knows it best? Staltz is also a great source to explore for learning more about the concept of reactive programming.)
- Casey A. Childers introduces the main concepts
- Ivan Jovanovic discusses switching from React to Cycle.js and how to work with HTTP streams
- Of course, browsing the getting started guide is a no-brainer and is very in depth
- The official Cycle.js Twitter occasionally links to other relevant materials
So, what’s your verdict? Is Cycle.js an underdog that deserves more love, or do you recommend it with caution?