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
will leave you with a listener in O1 and O2 will remain somewhere in memory. The same happens with weak = true - the mapped observable and the listeners remain. In these cases one can explicitly remove listener with off.(O2.inputs), which then allows them to be gced.
With on it's a bit different. There are no references being kept in inputs for on, so the above doesn't work. The gc will also happily remove the observable when it goes out of scope, causing this to error:
So in this case one would need to keep track of observer functions themselves to correctly remove a child. It would be nice if this was easier to handle.
The text was updated successfully, but these errors were encountered:
As far as I can tell there is no automatic way to remove a child observable and detach it from all its parents. For example
will leave you with a listener in
O1
andO2
will remain somewhere in memory. The same happens withweak = true
- the mapped observable and the listeners remain. In these cases one can explicitly remove listener withoff.(O2.inputs)
, which then allows them to be gced.With
on
it's a bit different. There are no references being kept ininputs
foron
, so the above doesn't work. The gc will also happily remove the observable when it goes out of scope, causing this to error:So in this case one would need to keep track of observer functions themselves to correctly remove a child. It would be nice if this was easier to handle.
The text was updated successfully, but these errors were encountered: