Cycle.js models applications as pure functions over reactive streams, with drivers handling DOM, HTTP, and other I/O effects.
Overview
Cycle.js is a JavaScript framework for building applications with functional, reactive programming. The core idea is a pure main function: inputs are read effects (sources) from the outside world and outputs are write effects (sinks), while drivers manage concrete I/O such as DOM updates and HTTP calls.
Application logic is built from reactive streams (xstream, RxJS, Most.js, and others), which keeps data dependencies visible in code. The public API centers on run(app, drivers), plus streams, drivers, and helpers to isolate child components. Community drivers exist for React Native, notifications, sockets, and more.
Cycle.js emphasizes explicit dataflow, testability by feeding inputs and checking outputs, and composability: child components expose the same sources/sinks interface as top-level apps. Documentation and examples cover virtual DOM rendering, server-side rendering, JSX, TypeScript, routing, and a Chrome DevTool for live dataflow graphs.
The project ships as multiple npm packages maintained together. Official docs, an Egghead video course, and release notes support learning and adoption.
Key features
- Pure main function with drivers
- Reactive stream-based logic
- Explicit visible dataflow
- Swappable I/O drivers
- Component isolation helper
- DOM driver and virtual DOM
- Server-side rendering support
- Chrome DevTool dataflow view
Use cases
- Interactive web UIs
- Event-driven frontends
- Testable effect-separated apps
- Stream-based SPAs
- Composable GUI widgets