Kefir

A Reactive Programming library for JavaScript

README

# Kefir

Kefir — is an Reactive Programming library for JavaScript
inspired by Bacon.js
and RxJS
with focus on high performance and low memory usage.

For docs visit kefirjs.github.io/kefir.
GitHub license npm version Build Gitter

Installation


Kefir available as NPM and Bower packages, as well as simple files download.

NPM


  1. ```sh
  2. npm install kefir
  3. ```

Bower


  1. ```sh
  2. bower install kefir
  3. ```

Download


See downloads section in the docs.

Also available on jsDelivr.

Browsers support


We don't support IE8 and below, aside from that Kefir should work in any browser.


The NPM package ships with Flow definitions. So you can do something like this if you use Flow:

  1. ``` js
  2. // @flow

  3. import Kefir from 'kefir'

  4. function foo(numberStream: Kefir.Observable<number>) {
  5.   numberStream.onValue(x => {
  6.     // Flow knows x is a number here
  7.   })
  8. }

  9. const s = Kefir.constant(5)
  10. // Flow can automatically infer the type of values in the stream and determine
  11. // that `s` is of type Kefir.Observable here.
  12. foo(s)
  13. ```

Development


  1. ```sh
  2. npm run prettify    # makes source code pretty (you must run it before a PR could be merged)
  3. npm run build-js    # builds js bundlers
  4. npm run test        # runs all the checks
  5. npm run test-only   # runs only unit tests without other checks
  6. npm run test-debug  # runs tests with a chrome inspector connected to the node process
  7. npm run build-docs  # builds the documentation html file
  8. ```