Replies: 2 comments 3 replies
-
Hiya. I think you may be reading too much into that example. For one thing, it's a standalone snippet that doesn't even show what It's true that if something inside of As a really bad example, imagine that we have an app that is simultaneously a "Todo List" and a "Counter". If I click the "Increment" button and dispatch This example in particular is really intended show the technique for "extracting extra arguments" and passing them on to the output function: Beyond that: you do not want to have |
Beta Was this translation helpful? Give feedback.
-
This seems to to help quite a bit.
@markerikson For Here's a contrived example:
|
Beta Was this translation helpful? Give feedback.
-
https://redux.js.org/usage/deriving-data-selectors#passing-input-parameters
In this example, I can see no way that it will not constantly recalculate the output, given that
state => state.items
will always be referencing a new array every time the store is modified.So if the redux store modified
item.completed = true
the this will get recalculated.**Question 1: Am I correct in this assumption? If so what is the point of this example, given that its supposed to show me how to prevent redraws?
Question 2: What is the best way to get access to the whole
state
object in theoutput
portion of thecreateSelector
if not like this example?**Beta Was this translation helpful? Give feedback.
All reactions