Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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