You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @adufilie we've run into and issue where, once an mobxpromise has been invoked, it will invoke forever whenever it's observables change, even if no views are observing it. I think this is expected mobx behavior, though not desirable. There needs to be a way to dispose a mobxpromise or at least disable it when there are no real observers. One solution I tried was, in the getter for lastinvokeId, we can detect the count of observers of the result property. Because of @cached, it will always be at least 1. If it's only 1, we could potentially NOT run invoke. The problem then is that we need to run invoke when the result property is referenced again (provided that observed values have changed). When I disabled invoke (when observer count ==1) the promise would never invoke again. Any thoughts?
The use case is, user leaves a tab, the mobxpromises of that serve that tab should not perpetually invoke.
The text was updated successfully, but these errors were encountered:
Hi @adufilie we've run into and issue where, once an mobxpromise has been invoked, it will invoke forever whenever it's observables change, even if no views are observing it. I think this is expected mobx behavior, though not desirable. There needs to be a way to dispose a mobxpromise or at least disable it when there are no real observers. One solution I tried was, in the getter for lastinvokeId, we can detect the count of observers of the result property. Because of @cached, it will always be at least 1. If it's only 1, we could potentially NOT run invoke. The problem then is that we need to run invoke when the result property is referenced again (provided that observed values have changed). When I disabled invoke (when observer count ==1) the promise would never invoke again. Any thoughts?
The use case is, user leaves a tab, the mobxpromises of that serve that tab should not perpetually invoke.
The text was updated successfully, but these errors were encountered: