Mirror: 馃帺 A tiny but capable push & pull stream library for TypeScript and Flow
1--- 2title: Introduction 3order: 0 4--- 5 6Wonka is a lightweight iterable and observable library loosely based on 7the [callbag spec](https://github.com/callbag/callbag). It exposes a set of helpers to create streams, 8which are sources of multiple values, which allow you to create, transform 9and consume event streams or iterable sets of data. 10 11## What it is 12 13Wonka is a library for streams _and_ iterables that behaves predictably 14and can be used for many problems where you're dealing with streams of 15values, asynchronous or not. 16 17It's similar to [RxJS](https://github.com/ReactiveX/rxjs) in that it enables asynchronous programming with 18observable streams, with an API that looks like functional programming on 19iterables, but it's also similar to [IxJS](https://github.com/ReactiveX/IxJS) since Wonka streams will run 20synchronously if an iterable source runs synchronously. 21 22It also comes with many operators that users from [RxJS](https://github.com/ReactiveX/rxjs) will be used to. 23 24## Compatibility 25 26Wonka is written in [Reason](https://reasonml.github.io/), a dialect of OCaml, and can hence be used 27for native applications. It is also compiled using [BuckleScript](https://bucklescript.github.io) to plain 28JavaScript and has typings for [TypeScript](https://www.typescriptlang.org/) and [Flow](https://flow.org/). 29 30This means that out of the box Wonka is usable in any project that use the following: 31 32- Plain JavaScript 33- TypeScript 34- Flow 35- Reason/OCaml with BuckleScript 36- Reason/OCaml with `bs-native` 37- Reason/OCaml with Dune and Esy 38 39In summary, Wonka provides a consistent interface in and works across 40TypeScript/Flow/Reason/OCaml environments with full type safety. 41 42## About the docs 43 44As mentioned in the prior section, Wonka supports not one but a couple of 45environments and languages. To accommodate for this, most of the docs 46are written with examples and sections for TypeScript and Reason. 47 48We don't provide examples in most parts of the docs for Flow and OCaml because 49their respective usage is almost identical to TypeScript and Reason, so for 50the most part the examples mostly deal with the differences between a 51TypeScript and a Reason project.