4 ms·
Point 2 in this article says a global store is the solution to its example problem. If there are any details of the example problem that make a global store the
by brlewis 7y ago
Point 2 in this article says a global store is the solution to its example problem. If there are any details of the example problem that make a global store the best solution, those details are not given. Generally you store a component's state in the component, and store shared state in a common ancestor of the components that share it.
- mfrye0 7y agoYeah, he didn't do the best job of explaining why in that example. Using a global store makes sense when your todo list evolves and the component storing the data is no longer mounted / exists. Examples could be: - Full page individual todo edit - Separate component / page that uses the same data - Some background logic that does X based on the todo data