redux-falcor icon indicating copy to clipboard operation
redux-falcor copied to clipboard

fetchFalcorDeps shouldn't be an instance method

Open limscoder opened this issue 8 years ago • 4 comments

fetchFalcorDeps should be a stand-alone function similar to mapStateToProps so the component doesn't need to know anything about falcor.

reduxFalcor(fetchFalcorDeps, component)

limscoder avatar Aug 11 '16 16:08 limscoder

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.

blizzardzheng avatar Aug 23 '16 09:08 blizzardzheng

waiting for resolve

blizzardzheng avatar Aug 23 '16 09:08 blizzardzheng

@limscoder @blizzardzheng Totally agree. Unfortunately I don't have time to maintain this project anymore. But happy to review PRs for this!

ekosz avatar Aug 23 '16 17:08 ekosz

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;

pickhardt avatar Aug 28 '16 02:08 pickhardt