Answer the question
In order to leave comments, you need to log in
Reselect: how to cache data written to reducer?
I try reselect and the problem immediately arose: data polling works. Almost every time the same data arrives in the reducer - the component rerenders using this data. I try to cache this data using the selector - it doesn't work - the rerender still happens. What is wrong in this code?
function getAllTickets(reducer) {
return reducer.get('tickets');
}
export const allTicketsSelector = createSelector([getAllTickets], items => items);
Answer the question
In order to leave comments, you need to log in
By default, createSelector uses the shallow comparison function. If you want to do a deep comparison, use createSelectorCreator and your comparison function. There is an example in the documentation .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question