https://github.com/reactjs/reselect#createstructuredselectorinputselectors-selectorcreator--createselector
I'm curious what the intent of the method is. I thought reselect was supposed to help with performance optimizations, but not sure why one would create a reselect selector for a mapping that does no computations other than creating a new object. Are there performance gains from using memoization in such cases?
Thanks.
It's there purely for convenience. If you have selectors a, b, and c, createStructuredSelector means the difference between:
createSelector(a, b, c, (ax, bx, cx) => ({a: ax, b: bx: c: cx})
and:
createStructuredSelector({a, b, c})
I think the benefit is with composing selectors. It helps to reduce some boilerplate. It's not meant to be used by itself. Thanks.
Most helpful comment
It's there purely for convenience. If you have selectors
a,b, andc, createStructuredSelector means the difference between:and: