Skip to content

Instantly share code, notes, and snippets.

@FrancoSirena
Created September 1, 2019 11:19
Show Gist options
  • Save FrancoSirena/ed36edc43e83026fac685cc0c423ff28 to your computer and use it in GitHub Desktop.
Save FrancoSirena/ed36edc43e83026fac685cc0c423ff28 to your computer and use it in GitHub Desktop.
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