A reactive programming library for JavaScript.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
test/support
.babelrc
.gitignore
.travis.yml
CHANGELOG.md
LICENCE.md
Makefile
README.md
jsdoc.config.json
logo.png
package-lock.json
package.json
rollup.config.js

README.md

Bulb

Build Status

Bulb is a reactive programming library for JavaScript. It provides a simple API for writing event-based programs in a declarative style.

The main data type introduced by Bulb is called a signal. A signal can represent any time-varying source of values — for example, the value of a text input, a periodic timer, or even the position of the mouse pointer in the browser.

The Bulb API provides many functions for creating signals from existing sources (e.g. AJAX requests, DOM events, timers, etc.) and for performing operations on signals.

A number of libraries already exist for reactive programming in JavaScript (e.g. RxJS, Bacon.js, Most.js), but Bulb differs in that it tries to avoid providing a "kitchen sink". Instead, Bulb defines a very focussed API which provides only the key building blocks for reactive programming in the JavaScript language.

Features:

  • Simple, focused API. Bigger isn't always better.

  • It's small, roughly 4 KB when minified and gzipped!

Table of Contents

Getting Started

CDN

The quickest and easiest way to start using Bulb is to include a reference to the minified file in the head of your HTML file.

You can always grab the latest version with:

<script src="https://unpkg.com/bulb/dist/bulb.min.js"></script>

You can also use a specific version with:

<script src="https://unpkg.com/bulb@1.0.0/dist/bulb.min.js"></script>

Node

Install the npm package:

> npm install bulb

Require it in your code:

var bulb = require('bulb')
var s = bulb.Signal.of(1)

Or, if you are using ES6 modules, you can import just the bits you want:

import {Signal} from 'bulb'
const s = Signal.of(1)

Documentation

Examples

Licence

Bulb is licensed under the MIT licence. See the LICENCE file for more details.