When does the view cache clear? #1730
-
Hi Everyone. I was working with mobx-state-tree and I created a view for a simple fullName property combining firstName and lastName seeing as how mobx-state-tree caches the results, I was wondering how can I be 100% certain the results would be computed again when needed (e.g when firstName changes). I was hoping someone here knows or can point me in the right direction. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@ronen-e Any properties that are accessed within a view are then "remembered" as being accessed, which then ensures that the computation gets computed again when they change. I don't have the code handy for showing you how this is done, but it seems to be pretty reliable to me. |
Beta Was this translation helpful? Give feedback.
@ronen-e Any properties that are accessed within a view are then "remembered" as being accessed, which then ensures that the computation gets computed again when they change.
I don't have the code handy for showing you how this is done, but it seems to be pretty reliable to me.