Wonka is a lightweight, capable push and pull stream library designed for TypeScript and Flow, loosely adhering to the callbag specification. Currently at stable version 6.3.6, it provides a functional approach to handling event streams and iterable data sets, offering helpers to create, transform, and consume multiple values over time. The project maintains an active release cadence, with frequent patch updates addressing minor fixes and improvements, and occasional minor versions introducing new features, such as adding the `addOne` argument to `takeWhile` in `v6.3.0`. Its key differentiators include its small bundle size, strong TypeScript integration, and a focus on composing operations through a `pipe` function, offering a pragmatic alternative to larger reactive programming libraries while maintaining clear stream semantics. Version 6 notably shifted its focus exclusively to TypeScript, Flow, and JavaScript environments, dropping support for Reason/OCaml/esy/dune that was present in v5.
npm install wonkaVerified import paths — ran on the pinned version, not inferred.
Demonstrates creating a stream from an array, applying `filter` and `map` operators, and subscribing. It also shows how to create a custom observable source using `make` with teardown logic for an interval stream.
For existing Reason/OCaml projects, consider staying on `wonka@5` or porting stream logic to a JavaScript/TypeScript compatible implementation.
Ensure that any custom `ObservableSubscription` implementations or type assertions explicitly define `closed: boolean`. Update any logic that might check for `subscription.closed == null` to `subscription.closed === false` or `subscription.closed === true`.
Update to `wonka@6.3.4` or higher to resolve missing `Symbol.observable` typings. If unable to update, manually declare `Symbol.observable` globally if necessary for your environment.
Update to `wonka@6.3.1` or higher to include the fix for ambient enum declarations.
Switch to ES Module `import` syntax (e.g., `import { pipe } from 'wonka';`). Ensure your project is configured for ESM, or use a bundler that correctly handles module resolution.Always use `pipe()` as a standalone function: `pipe(source, operator1, operator2, ...)`. Do not try to call `source.pipe()`.
Update to `wonka@6.2.5` or later. If sticking to older versions, adjust your TypeScript types to explicitly allow `boolean | undefined` for `closed` if you're writing custom subscription logic.
No dependency data recorded yet.