Last active
November 2, 2018 20:36
-
-
Save jsrath/dcd60fc460af2907dde906298a11c1df 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
Promise.all([ | |
fetch('/api/movies', { | |
headers: new Headers({ | |
'ApiKey': 'USER_KEY_2', | |
}), | |
}), | |
fetch('/api/series', { | |
headers: new Headers({ | |
'ApiKey': 'USER_KEY_2', | |
}), | |
}), | |
]) | |
.then(([res1, res2]) => Promise.all([res1.json(), res2.json()])) | |
.then(([movies, series]) => | |
this.setState({ | |
Individual: [...movies.items, ...series.items], | |
}), | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment