-
Notifications
You must be signed in to change notification settings - Fork 94
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
Destructor #118
Comments
This is a great idea, thanks for bringing it up.
|
I find |
I was under Swift influence with |
Might want to reserver $delete for something later on. |
$destroy +1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Motivation
Components currently support the
$init
callback that fires when the element is generated for the first time. This enables construction logic such as enabling a specific behaviour, issuing an API call or, as outlined here, subscribing to an observable.However, the lifetime of an element might come to an end, typically due to a user action (e.g., closing a widget which removes a bunch of elements). In this case, it becomes necessary to terminate all ongoing transactions created by this element, such as cancelling API calls or unsubscribing from an observable. Such logic typically resides in a destructor callback, which could be called
$deinit
.What about adding such callback? Or what would be the alternatives?
The text was updated successfully, but these errors were encountered: