Last active
January 9, 2019 20:47
-
-
Save thejohnfreeman/40f90d533ec2f097c3545ba0d138380b 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
function async(makeGenerator) { | |
// Return a function that constructs an Observable. | |
return function(...args) { | |
return Observable.create(observer => { | |
// This function won't be called until the observable is subscribed. | |
const generator = makeGenerator.apply(this, args) | |
return new GeneratorSubscriber(observer, generator) | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment