We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I just discovered proxy-memoize recently I think it has a good potential.
proxy-memoize
One thing I think is incorrect is the statement that the last example can't be written in reselect
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
The text was updated successfully, but these errors were encountered:
Thanks for jumping in.
My apologies, that was too easy without detailed info.
const state = { todos: [{ text: 'aaa', completed: true }, { text: 'bbb', completed: false }] }
We assume this case, and when only completed is changed.
completed
Please refer this too: reduxjs/react-redux#1653 (comment)
Sorry, something went wrong.
Aha, now I get it. You are absolutely right - reselect's selector will recompute in this case, whereas memoize's won't.
memoize
Clarify last example issue with reselect
ff65ff0
Resolves: dai-shi#15
Clarify last example issue with reselect (#18)
c2bc774
Resolves: #15
Successfully merging a pull request may close this issue.
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:
Here is how I see it in
reselect
:The text was updated successfully, but these errors were encountered: