redux-falcor
redux-falcor copied to clipboard
fetchFalcorDeps shouldn't be an instance method
fetchFalcorDeps
should be a stand-alone function similar to mapStateToProps
so the component doesn't need to know anything about falcor.
reduxFalcor(fetchFalcorDeps, component)
i agree , when i just use for arrow pure function like this
const CounterApp = (props) => { const { counter, actions } = props; return ( <div> <Counter counter={counter} {...actions} /> </div> ); };
and it will throw error that Cannot read property 'fetchFalcorDeps' of null the component need not to know anything about falcor.
waiting for resolve
@limscoder @blizzardzheng Totally agree. Unfortunately I don't have time to maintain this project anymore. But happy to review PRs for this!
Instead of reduxFalcor(fetchFalcorDeps, component)
I propose reduxFalcor(component, fetchFalcorDeps)
for backwards compatibility. The second param fetchFalcorDeps
would be optional, like this:
fetchFalcorDeps = fetchFalcorDeps || wrappedInstance.fetchFalcorDeps;