Can't pass props in selectors
react-redux supports passing props to select. Currently reselect only passes state. Is it possible to add props to selector functions?
I'm not sure that the new react-redux api for the connect decorator is going to support this. Check out this PR
Huh. That would be unfortunate... Maybe @gaearon can clarify?
Seems that there will be an additional argument for @connect decorator for using props to further filter the state. So I guess that yes, this api will get deprecated.
Confirmed as gone in the release notes for react-redux v.0.5.0
It looks like this added back in react-redux. Can we get it back in this package?
Yep, I guess we should look into this now
Any time frame on this? Attempted to jump in on a fork, but didn't know if changes were coming soon for a 1.0.
Funnily enough, I was just looking at it. Did you have a plan? I'm wondering how the dumb default memoize and its reference equality is going to work with the props. I don't recall how the props are handled inside react. I guess if the prop object is mutative and has a stable reference for the lifetime of the component or it is recreated entirely on each render then we might have problems?
I think that the API might change slightly in the next version, possibly allowing the user to specify a memoization function in createSelectorCreator and allowing variadic depencies. I just started exploring this in my fork here if you'd like to have a look.
I guess if the prop object is mutative and has a stable reference for the lifetime of the component or it is recreated entirely on each render then we might have problems?
Props object is new every time. It's considered immutable.
Okay, I just finally started using reselect in a project and ran into this one. So basically we want to parameterize the select expression with an additional object that should be passed down the select chain, right? And we should be able to express when we consider this object unchanged, so that we can make use of caching.
Take a look at #35. We've had a bit of a discussion about this there
Address in the 1.0.0 release