Contributors, pull requests, and issues welcome!
Have a look at the annotated source code.
Check out the meager test suite.
Elm is really cool, but it's Haskell that compiles to JavaScript. Transpiling gives me the willies. Until native debugging for the languages is available in most browsers, you'll still need to understand the JavaScript environemnt in order to find issues.
Flapjax is also cool, but it's self-contained and looks like it was written by Haskellers. I want a library that I can integrate with existing code in a JavaScript style.
- Provide a JavaScript library using familiar idioms constrained by the style of FRP.
- Make use of underscore.js and jQuery to avoid reinventing useful functions.
- Provide a fast, continuation-based iterator system with common patterns already implemented.
- Provide useful tools for mapping along streams of
$.Deferred
objects. - Provide utilities for binding to Google Maps.
- jQuery 1.10.1
- Underscore 1.4.4
frp.Stream.$('body', 'click', 'button.twiddle').build(
'map', [function(e) { return $(e.target).closest('button').hasClass('on'); }],
'unique', []);
This streams boolean values reflecting the button state ('on'
), but only when
that value changes.
frp.Stream.$('canvas', 'mousemove').build(
'map', [function(e) { return {'x': e.pageX, 'y': pageY}; }],
'lastN', [2],
'atLeastN', [2],
'filter', [function(pos) { return slope(pos[1], pos[0]) > 2; }],
'mapApply', [function(b, a) { return b; }]);
This streams the mouse position whenever the slope from the previously recorded position is greater than 2.