Cached computed values are not invalidated when state ancesters are removed
See original GitHub issueGiven a Computed:
export default Computed({
value: 'parent.value'
}, ({ value }) => value ? value * 2 : 'missing')
The computed response will not return 'missing'
when parent
is deleted from the state tree, it will return an older cached response.
Issue Analytics
- State:
- Created 7 years ago
- Comments:14 (14 by maintainers)
Top Results From Across the Web
Question: side effects for caching in @computed values with ...
I'm new to mobx and am trying to implement caching for my application's state using @computed values but am running into an error....
Read more >Invalidating Computed with The Composition API
Once any of the reactive properties change, the computed property cache will be invalidated and the getter will re-run.
Read more >VueJs computed property without caching - Stack Overflow
I suspect that the value is cached because the inner state stay on invalid and thus the cache is used. Using a method...
Read more >Node (JavaFX 8) - Oracle Help Center
Returns true if the given rectangle (specified in the local coordinate space of this Node ) intersects the shape of this Node ....
Read more >Vue: When a computed property can be the wrong tool
A computed property's result is cached. In our example above, that means that as long as the todos array doesn't change, calling openTodos.value ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah I see @garth. So, I would say this is definitely a bug. 😃 All child paths need to get marked as changed if their parent is deleted (or updated). I think that logic should always be the case.
I am just closing this as it is getting old, please reopen if still an issue here 😃