Created
February 9, 2013 03:11
-
-
Save wheeyls/4743675 to your computer and use it in GitHub Desktop.
riffle.js is a little nicer and more transparent than bacon.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // call this separately to load the lib... | |
| $.getScript('https://rawgithub.com/flowgrammer/Riffle/master/riffle.js').then(function () { | |
| var clicks = stream(function (outFn, selector) { | |
| $(selector).on('click', function (ev) { | |
| outFn($(this)); | |
| }); | |
| }) | |
| , hrefs = stream(function (outFn, $element) { | |
| outFn($element.attr('href')); | |
| }) | |
| ; | |
| hrefs.input(clicks); | |
| clicks.invoke('[data-focus-id] > a'); | |
| hrefs.onOutput(function (href) { | |
| console.log(href); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment