reselect icon indicating copy to clipboard operation
reselect copied to clipboard

keypaths

Open faassen opened this issue 11 years ago • 1 comments

We could implement key path arrays as an argument to createSelector as a shortcut, i.e instead of this:

createSelector([state => state.a.b], value => value);

we could allow this:

createSelector([['a', 'b']], value=>value);

Or alternatively a string spelling:

createSelector(['a.b'], value=value);

to get an object.

We should make how to interpret a key path pluggable in createSelectorCreator. This way application authors can deal with special cases where state is a ES6 Map or an Immutable.js object, or whatever else.

We could even interpret anything that's not a function as a "keypath" and pass it along to the key path resolver function, in which case using an array or a dotted name is up to the application author.

faassen avatar Jul 01 '15 12:07 faassen

Our first issue! I am going to close it out now because no-one has asked for it, so I don't think it is going to get implemented.

ellbee avatar Dec 07 '15 13:12 ellbee