Last active
November 16, 2016 09:20
-
-
Save webpapaya/9fd42a7234b57688c6a0553e7f7d32ad 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
import { queue, retry } from 'promise-frites'; | |
const myApiCall1 = () => Promise.resolve() | |
.then(() => { /* call server */ }) | |
.then(() => { /* notify user */}) | |
.then(() => { /* call server again */ }) | |
.then(() => { /* notify user again */}); | |
const myApiCall2 = () => Promise.resolve() | |
.then(() => { /* call server */ }) | |
.then(() => { /* notify user */}); | |
Promise.resolve() | |
.then(queue(...[myApiCall1, myApiCall2])); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment