Closed
Description
I just discovered proxy-memoize
recently I think it has a good potential.
One thing I think is incorrect is the statement that the last example can't be written in reselect
The last example is this one:
const todoTextsSelector = memoize(state => state.todos.map(todo => todo.text));
Here is how I see it in reselect
:
const state = {
todos: [{ text: 'aaa' }, { text: 'bbb' }]
}
const todoTextSelector = createSelector(
state => state.todos,
todos => todos.map(todo => todo.text)
)
console.log(todoTextSelector(state)) // ["aaa", "bbb"]
console.log(todoTextSelector(state)) // ["aaa", "bbb"]
console.log(todoTextSelector(state)) // ["aaa", "bbb"]
console.log(todoTextSelector(state)) // ["aaa", "bbb"]
console.log(todoTextSelector.recomputations()) // 1
Metadata
Metadata
Assignees
Labels
No labels