Observable for the calorie conscious
Switch branches/tags
add-lock-file-update added-sources additional-ops baseobserver-remove benchmark-refactoring bm-html build-for-browsers builds change-output-dir change-typings-directory cold-observable combine-files combine-new combine-scheduler-files combine commentator-migration composite-subscription-linkedlist concat concurrent-stream config-test-params create-func curry-fix currying debounce-operator-refactor debounce default-observer-class default-subscribe delay-operator deprecate-rafthrottle depricate-setImmediate develop disable-dec doc-api doc-update esdoc-generator esdoc export-default export-extra-all export-extra export-utils expose-subscription extra-updates feat-combine feature/make-marble-size-atomic fix-definitions fix-events fix-foreach fix-observable-ctor fix-signatures fix/skip-repeats-typings fixups flat-map fluid-only fluid-style fluidic-style frames-scheduler from-dom-event from-promise fromArray fromDOM-signature fromPromise fromarray-timer greenkeeper-benchmark-2.1.2 greenkeeper-gh-pages-1.0.0 greenkeeper-rollup-0.40.1 greenkeeper-rollup-0.41.1 greenkeeper-rollup-plugin-uglify-2.0.0 greenkeeper-rollup-plugin-uglify-2.0.1 greenkeeper-tslint-5.2.0 greenkeeper-tslint-5.3.0 greenkeeper-tslint-5.3.2 greenkeeper/prettier-1.15.0 greenkeeper/prettier-1.15.1 greenkeeper/prettier-1.15.2 greenkeeper/prettier-1.15.3 greenkeeper/rollup-0.53.0 greenkeeper/rollup-0.60.0 greenkeeper/rollup-0.60.1 greenkeeper/rollup-0.60.2 greenkeeper/rollup-0.60.3 greenkeeper/rollup-0.60.4 greenkeeper/rollup-0.60.5 greenkeeper/rollup-0.60.6 greenkeeper/rollup-0.60.7 greenkeeper/rollup-0.61.0 greenkeeper/rollup-0.61.1 greenkeeper/rollup-0.61.2 greenkeeper/rollup-0.62.0 greenkeeper/rollup-0.63.0 greenkeeper/rollup-0.63.1 greenkeeper/rollup-0.63.2 greenkeeper/rollup-0.63.3 greenkeeper/rollup-0.63.4 greenkeeper/rollup-0.63.5 greenkeeper/rollup-0.64.0 greenkeeper/rollup-0.64.1 greenkeeper/rollup-0.65.0 greenkeeper/rollup-0.65.1 greenkeeper/rollup-0.65.2 greenkeeper/rollup-0.66.0 greenkeeper/rollup-0.66.1 greenkeeper/rollup-0.66.2 greenkeeper/rollup-0.66.3 greenkeeper/rollup-0.66.4 greenkeeper/rollup-0.66.5 greenkeeper/rollup-0.66.6 greenkeeper/rollup-0.67.0 greenkeeper/rollup-0.67.1 greenkeeper/rollup-0.67.2 greenkeeper/rollup-0.67.3 greenkeeper/rollup-0.67.4 greenkeeper/rollup-plugin-uglify-5.0.0 greenkeeper/rollup-plugin-uglify-5.0.1 greenkeeper/rollup-plugin-uglify-5.0.2 greenkeeper/rollup-plugin-uglify-6.0.0 greenkeeper/semantic-release-15.10.3 greenkeeper/semantic-release-15.10.4 greenkeeper/semantic-release-15.10.5 greenkeeper/semantic-release-15.10.6 greenkeeper/semantic-release-15.10.7 greenkeeper/semantic-release-15.10.8 greenkeeper/semantic-release-15.11.0 greenkeeper/semantic-release-15.12.0 greenkeeper/semantic-release-15.12.1 greenkeeper/semantic-release-15.12.2 greenkeeper/semantic-release-15.12.3 greenkeeper/semantic-release-15.12.4 greenkeeper/semantic-release-15.12.5 greenkeeper/travis-deploy-once-5.0.10 greenkeeper/@types/node-10.11.1 greenkeeper/@types/node-10.12.0 greenkeeper/@types/node-10.12.1 greenkeeper/@types/node-10.12.2 greenkeeper/@types/node-10.12.3 greenkeeper/@types/node-10.12.4 greenkeeper/@types/node-10.12.5 greenkeeper/@types/node-10.12.6 greenkeeper/@types/node-10.12.7 greenkeeper/@types/node-10.12.8 greenkeeper/@types/node-10.12.9 greenkeeper/@types/node-10.12.10 greenkeeper/@types/node-10.12.11 greenkeeper/@types/node-10.12.12 greenkeeper/@types/node-10.12.13 greenkeeper/@types/node-10.12.14 greenkeeper/@types/node-10.12.15 just linked-list-length-fix linked-list-rename linkedlist-extensions linter marble-fix marble-test master merge migrate-test-ts mocha-migration mono-repo move-types multicast never no-inlining observable-class observable-constructor only-operator op-concat package-fixes perf-updates raf-throttle refactor-names remove-bm-save remove-class-exports remove-combine remove-depricates remove-dist-folder remove-docs remove-duplicates remove-fluid remove-observable remove-observer-start remove-subject remove-unused-exports rename-bm-file rename-interfaces rename-reactive-tests revert-96-fluid-only rollup-build rollup-ts-config rx-alternative safe-observer safe-value-internalize sample-fixup sample-with scan-perf scan-reduce-bm scheduler-fixes scheduler-perf scheduler-simplify scheduler scheduling-strategy skip-repeats-refactor skipRepeats slice-unsubscribe smaller-files subject-error subject subscription-closed-fix support-subject switch-benchmarks switch take-until takeN-rename test-option-centralize test-refactors test-scheduler-fixes test-scheduler throttle travis-bot travis-fixes travis-speedup try-catch-refactor trycatch-bm-update tslint typings update-deps-0 update-deps-2 update-deps update-dir-struc updates use-mixins workspaces yarn-hooks
Nothing to show
Clone or download
tusharmath Merge pull request #257 from tusharmath/greenkeeper/ts-node-7.0.0
Update ts-node to the latest version 🚀
Latest commit 711f669 Aug 4, 2018

README.md

Observable Air

Greenkeeper badge

Build Status npm Coverage Status

A 4kb high performance alternative to RxJS.

If you are new to reactive programming then you should definitely checkout — The introduction to Reactive Programming you've been missing

Links

Usage

CommonJS

const O = require('observable-air')

ES6 or Typescript

import * as O from 'observable-air'

HTML

<script src="https://unpkg.com/observable-air/.dist/observable-air.umd.min.js"></script>

<script>
  O.forEach(
    console.log,
    O.scan((a) => a + 1, 0, O.interval(1000))
  )
</script>

Example

import * as O from 'observable-air'
import * as R from 'ramda'

const timer = R.compose(
  O.forEach(console.log),
  O.scan(R.add, 0),
  O.interval
)

timer(100) // outputs 1, 2 ,3, 4 ... every 100ms
timer(1000) // outputs 1, 2 ,3, 4 ... every 1000ms

Installation

npm install observable-air --save

Why an RxJS Alternative?

RxJS is awesome and an inspiration for this a lot of other observable libraries out there. Air is focussed on some fundamental things such as —

  1. Smaller Footprint: Rx has a lot of operators which makes the library quite large in size. Air has a much smaller number of operators and is architected such that more sophisticated operators can be created using the already available ones without any performance overhead of composition.

  2. Functional Over Fluidic: Air embraces a functional API rather than a fludic one. All the functions come curried out of the box and work really well with ramda.

  3. Performance: Air is significantly faster than Rx, benchmarks coming up soon.

  4. Virtual Time: In Rx VirtualTimeScheduler is passed as an argument to each operator, in Air the TestScheduler is passed once at the time of subscription and is internally shared up the chain of its parent operators or sources.