Skip to content

Instantly share code, notes, and snippets.

@ntkoso
ntkoso / container.js
Last active January 17, 2018 08:20
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);