Skip to content

Instantly share code, notes, and snippets.

Last active Nov 10, 2018
What would you like to do?
Youtube in React: consecutive requests in saga
export function* fetchWatchDetails(videoId) {
let requests = [
buildVideoDetailRequest.bind(null, videoId),
buildRelatedVideosRequest.bind(null, videoId),
try {
const responses = yield all( => call(fn)));
yield put(watchActions.details.success(responses));
yield call (fetchVideoDetails, responses);
} catch (error) {
yield put(watchActions.details.failure(error));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment