Releases: 0no-co/wonka
v3.2.1
v3.2.0
This release adds the toArray
sink utility. Read more about it in the docs
It also adds the missing sideEffects: true
flag to the package.json
file.
v3.1.0
With this release a new documentation site for Wonka is finally ready! You can find it at wonka.kitten.sh. It contains a "Getting Started" guide, docs on how Wonka works and why it exists, and an extensive API reference with sections for each utility (sources, operators, and sinks)
This release also introduces four new operators! 🎉
fromObservable
has been added to convert spec-compliant JS Observables to Wonka sources, and toObservable
has been added to convert Wonka sources to JS Observables.
fromCallbag
has been added to convert spec-compliant JS Callbags to Wonka sources, and toCallbag
has been added to convert Wonka sources to JS Callbags.
This should facilitate full interoperability with Observables (including libraries like zen-observable and RxJS) and with Callbags!
Furthermore, the buffer
operator has been added. It can be used to group emitted values from a Wonka source into arrays every time a notifier source emits.
The sample
operator has been moved out of WonkaJs
and is now usable in non-JavaScript environments. It never actually used any JS APIs and has erroneously been locked down before.
Lastly, this release fixes a bug in the bsconfig.json
config. Before the namespace
flag has been flipped to true
, which caused unexpected issues. This wasn't needed since all modules in Wonka have been named to avoid conflicts already and caused every module to only be accessible under Wonka.Wonka
instead of just Wonka
.
The release for everyone! 🌍🌎🌏
This is a very exciting, new release. Exciting because it adds support for two new environments: Flow and Dune!
This brings the list of supported JS, Reason, and OCaml environments up to all popular ones, since Flow is still popular for typed JS and Dune is an ever-growing build toolchain for native Reason/OCaml.
Hence the full list of supported environments is now:
- TypeScript
- JS/Flow
- Reason/OCaml Bucklescript
- Reason/OCaml bs-native
- Reason/OCaml Dune
No breaking changes should've been introduced 🎉
v1.2.0: Refactor & Solid TypeScript support
Sorry for the many releases and the noise that this refactor has generated! 😅
This release note summarises some of the changes that have been published since v1.
Uncurrying Refactor
Wonka's internal types have been completely overhauled! All internal-only
callbacks are now explicitly uncurried, including sinkT('a)
and (.talkbackT) => unit
.
Type aliases have also been added for sinks (sinkT('a)
) and sources (sourceT('a)
)
which should make the codebase and signatures a lot easier to read.
Meanwhile the variants have been cleaned up. There's no duplicate End
event.
Instead, when a sink requests a source to be completed it now sends Close
.
TypeScript Support
This change is the most significant and really exciting! Wonka now has full TypeScript support!
Some functions have been explicitly curried so that the usage of all functions that Wonka exposes
are idiomatic. The JS bundle also exposes a pipe
function. This allows TypeScript users to
write code that looks surprisingly much like RxJS code:
import { pipe, fromArray, map, filter, forEach } from 'wonka';
pipe(
fromArray([1, 2, 3, 4]),
map(x => x * 2),
filter(x => x > 2),
forEach(x => console.log(x))
);
/* logs: 4, 6, 8 */
Minor additions
- Subjects are now supported!
- added
toPromise
- added
tap
Minor refactors
The library now relies on bs-rebel instead of raw
Belt
based code that was used mostly for Belt.MutableMap
. Rebel compiles away
to nice JS Array operations most of the time and falls back to Belt
for bsb-native
compilation.