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
module.exports = function(grunt) { | |
// load only required grunt tasks as tasks are run | |
require('jit-grunt')(grunt); | |
// Project configuration. | |
grunt.initConfig({ | |
browserify : { | |
files : { | |
'test/browserified_unit_tests.js' : 'test/spec/**.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
/** | |
* Similar to Bacon.fromNodeCallback except instead of a single callback, | |
* the value and error result are split to two different callbacks. | |
* Works for the form method(...args, successCallback, errorCallback); | |
* This style of API is used by https://developer.mozilla.org/en-US/docs/Web/API/Navigator/getUserMedia | |
*/ | |
Bacon.fromBifurcatedCallback = function(method, ...args) { | |
return Bacon.fromBinder(sink => { | |
args.push(res => { | |
sink(res); |
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
/** | |
* Waits until the supplied stream emits a value, and then | |
* continues by emitting the last value emitted on the target. | |
* Useful when you want to gate on an event emitter. | |
*/ | |
Bacon.Observable.prototype.waitUntil = function(item) { | |
// Cache the last value to come out of the source. | |
let last; | |
const unsub = this.onValue(x => last = x); |