Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Signals in a functional reactive style
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
test
.travis.yml
History.md
License.md
Readme.md
core.js
hub.js
package.json
pipe.js

Readme.md

signalize

Build Status

Browser support

Functional Reactive Programming (FRP) is a programming paradigm for working with time-varying values, better capturing the temporal aspect of mutable state. Signal is a data structure representing a time-varying value. For example, consider the position of the mouse. The signal mousePosition represents current mouse position. When the mouse moves, the value changes automatically.

Signals can also be transformed and combined without typical hazards of the stateful programs.

Example

Signal is very low level construct that can be used to create signals from scratch:

var signal = require("signalize/core").signal
var time = signal(function(next) {
  setInterval(function() {
    next(Date.now())
  }, 1000)
})

Signals can be spawned in order to consume it's changes:

var spawn = require("signalize/core").spawn

spawn(time, function(value) {
  console.log(value)
})

// => 1352077824718
// => 1352077825719
// => 1352077826720
// => 1352077827721
// => 1352077828722
// => 1352077829723

Install

npm install signalize
Something went wrong with that request. Please try again.