finds.dev

staltz/xstream

An extremely intuitive, small, and fast functional reactive stream library for JavaScript

View on GitHubHomepage ↗

★ 2,369TypeScriptMITupdated Jul 2023

// the take

A small, hot-only reactive stream library for JavaScript/TypeScript, built as the reactive core for Cycle.js. It's for people who want FRP-style data flow without RxJS's enormous operator surface, and who are fine working within Cycle's ecosystem or hand-rolling similar patterns elsewhere.

The 26-operator core is a real design decision, not a limitation apologized for — it avoids the 'which of 12 similar RxJS operators do I use' paralysis. Streams are multicast by default (no cold-observable surprises where each subscriber triggers its own side effects), which removes a class of bugs RxJS beginners hit constantly. The Producer abstraction with reference-counted start/stop is clean and easy to reason about, and the core/extras split (import from `xstream/extra` only what you need) keeps the ~30kB footprint honest.

No commits or releases since mid-2023 and it's essentially a two-person project (staltz, TylorS) — before adopting it outside Cycle.js, check whether it's actually still maintained or just quietly done. The deliberately small operator set means anything beyond basic flows (concurrent flattening, buffering, backpressure) requires reaching into `extra/` or writing custom operators by hand, which partly defeats the 'intuitive' pitch. `imitate()` for circular stream dependencies is a sharp edge — it silently breaks on MemoryStreams with no compile-time guard, just a FAQ entry warning you after the fact. It's tightly coupled in spirit to Cycle.js, which itself has far smaller adoption than the mainstream reactive libraries, so you're adopting two niche things at once if you're not already in that ecosystem.

We read the README, the directory tree and a key source file in October 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
2,369
Forks
139
Language
TypeScript
License
MIT
Last commit
18 Jul 2023

// nearby

If xstream isn't quite it.

All repos →