Created
November 19, 2018 19:45
-
-
Save productioncoder/ae076b5be2706d663b71aed8eedd5736 to your computer and use it in GitHub Desktop.
Youtube in React: search for videos watcher saga
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
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