question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cached computed values are not invalidated when state ancesters are removed

See original GitHub issue

Given 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:closed
  • Created 7 years ago
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
bfitchcommented, Aug 17, 2016

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.

0reactions
christianalfonicommented, Sep 13, 2016

I am just closing this as it is getting old, please reopen if still an issue here 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found