Skip to content

Instantly share code, notes, and snippets.

@rgommezz
Last active June 12, 2017 12:36
Show Gist options
  • Select an option

  • Save rgommezz/7fcdba676ca604c8ea6f57864b30bc13 to your computer and use it in GitHub Desktop.

Select an option

Save rgommezz/7fcdba676ca604c8ea6f57864b30bc13 to your computer and use it in GitHub Desktop.
function* fetchData({ payload }) {
const accessToken = yield select(accessTokenSelector);
try {
const { data } = yield call(api.fetchData, accessToken, payload.params);
yield put(actions.fetchDataSuccess(events));
} catch (error) {
yield put(actions.fetchDataError(error));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment