Created
September 1, 2019 11:19
-
-
Save FrancoSirena/ed36edc43e83026fac685cc0c423ff28 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
import { select, put } from 'redux-sagas/effects'; | |
import { requestType, success } from './actions'; | |
import apiGenerator from './apiGenerator'; | |
function* fetchGlobalData({ | |
payload: { startDate } }) { | |
const api = yield select(apiGenerator); | |
const response = yield api.fetchHistoricalData(startDate); | |
yield put success(response); | |
} | |
return yield all([ | |
takeLatest(requestType, fetchGlobalData); | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment