Created
September 30, 2017 16:12
-
-
Save sriharshaj/504cfd117ca72181f9fe6e5d92f3a99d to your computer and use it in GitHub Desktop.
This file contains 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* getData(){ | |
let data = yield api.call('url'); | |
return data; | |
} | |
let gen = getData(); | |
let promise = gen.next(); | |
promise.then(data => { | |
gen.next(data); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment