How to memoize array of selectors?
How to memoize array of selectors? Example code: const menu = [ {type: "home", visSelector: someSelector}, {type: "accounts", visSelector: anotherSelector} ] const filterMenuItems = (state, menu) => menu.filter(i => i.visSelector(state)) const mapStateToProps = state => { menuItems: filterMenuItems(state, menu) } What is the right way to memoize filterMenuItems? visSelector are already memoized. Unfortunately, result of this filtration rerender component every time. It has to, as visSelector makes its decision based on the whole state, which changes at every rerender – Jonas W. Jun 26 at 15:07 visSelector Yep, i know. But how to handle such a case nicely? – ku8ar Jun 26 at 15:08 ...