Monday, 25 June 2018

Reselect - selector that invokes another selector?

I have a selector:

const someSelector = createSelector(
   getUserIdsSelector,
   (ids) => ids.map((id) => yetAnotherSelector(store, id),
);                                      //     ^^^^^ (yetAnotherSelector expects 2 args)

That yetAnotherSelector is another selector, that takes user id - id and returns some data.

However, since it's createSelector, I don't have access to store in it (I don't want it as a function because the memoization wouldn't work then).

Is there a way to access store somehow inside createSelector? Or is there any other way to deal with it?



from Reselect - selector that invokes another selector?

No comments:

Post a Comment