xstream is an open-source JavaScript library for functional reactive programming using lightweight event streams. It provides a small API for creating, transforming, and combining asynchronous sequences of values. Unlike traditional Observables, its streams are multicast by default, allowing multiple listeners to share the same execution. Developers can create streams from arrays, promises, periodic timers, and custom event producers. Built-in operators support mapping, filtering, folding, combining, and flattening event sequences. MemoryStreams retain their latest values for subsequent listeners. The library also provides subscription management, debugging utilities, and error handling. Its TypeScript-compatible design is particularly suited to Cycle.js applications and reactive user interfaces.
Features
- Lightweight Multicast Event Streams
- Functional Stream Transformation Operators
- Promise, Array, and Timer Stream Creation
- MemoryStreams with Latest Value Retention
- Stream Combination and Flattening
- TypeScript Support and Cycle.js Integration