Destructor
See original GitHub issueMotivation
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?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:11
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Destructors in C++ - GeeksforGeeks
What is a destructor? Destructor is an instance member function which is invoked automatically whenever an object is going to be destroyed.
Read more >Destructors - cppreference.com
A destructor is a special member function that is called when the lifetime of an object ends. The purpose of the destructor is...
Read more >Destructors (C++ only) - IBM
Destructors are usually used to deallocate memory and do other cleanup for a class object and its class members when the object is...
Read more >Destructor Definition & Meaning - Merriam-Webster
The meaning of DESTRUCTOR is a furnace or oven for the burning of refuse : incinerator.
Read more >Destructor - Wikipedia
Destructor (computer programming), in object-oriented programming, a method which is automatically invoked when an object is destroyed · Euronymous (1968–1993), ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
$destroy +1
I find
$destroy
nicer.