Skip to content

Instantly share code, notes, and snippets.

@productioncoder
Created November 19, 2018 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save productioncoder/ae076b5be2706d663b71aed8eedd5736 to your computer and use it in GitHub Desktop.
Save productioncoder/ae076b5be2706d663b71aed8eedd5736 to your computer and use it in GitHub Desktop.
Youtube in React: search for videos watcher saga
import * as searchActions from '../actions/search';
import {REQUEST} from '../actions';
import {fork, take} from 'redux-saga/effects';
export function* watchSearchForVideos() {
while (true) {
const {searchQuery, amount, nextPageToken} = yield take(searchActions.SEARCH_FOR_VIDEOS[REQUEST]);
yield fork(searchForVideos, searchQuery, nextPageToken, amount);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment