Created
September 8, 2016 11:11
-
-
Save jpwesselink/a904278578097d5fad4e60a03c701404 to your computer and use it in GitHub Desktop.
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
[bacon-workshopper] bacon-love current | |
02. Wrapping Values as Reactive Datatypes | |
[bacon-workshopper] cat exercise-02.js | |
module.exports = (Bacon, promise, eventTarget, callback) => { | |
const promiseStream = Bacon.fromPromise(promise); | |
const eventTargetStream = Bacon.fromEvent(eventTarget, 'data'); | |
const callbackStream = Bacon.fromCallback(callback); | |
return { | |
promise : promiseStream, | |
eventTarget: eventTargetStream, | |
callback: callbackStream, | |
array: Bacon.zipAsArray(promiseStream, eventTargetStream, callbackStream) | |
} | |
} | |
[bacon-workshopper] bacon-love verify exercise-02.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment