Newer
Older
import { withStateHandlers } from 'recompose'
export default withStateHandlers(
{

Alexandru Munteanu
committed
isFetching: false,

Alexandru Munteanu
committed
setFetching: ({ isFetching }) => value => ({
isFetching: value,
}),
toggleFetching: ({ isFetching }) => () => ({
isFetching: !isFetching,
}),
setError: ({ fetchingError }) => e => ({
fetchingError: e,
}),
clearError: ({ fetchingError }) => () => ({
fetchingError: '',
}),
},
)