-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removing a child observable #71
Milestone
Comments
xref #69. I don't currently have the bandwidth to tackle this but it's probably the one remaining big issue for this package to address. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: