Skip to content

Instantly share code, notes, and snippets.

@ifokeev
ifokeev / container.js
Created September 6, 2016 22:15 — forked from ntkoso/container.js
Server side data fetching using 'redux-saga'
import { fork } from 'redux-saga';
import fetchEntitySaga from './fetchEntitySaga';
export default prefetch(
({ getState }) => {
if (needsFetching(getState())) {
return fork(fetchEntitySaga, getState, ...args);
}
}
)(Component);