onInactive method
Called when the last listener is removed.
Override this method in subclasses to perform cleanup when the atom becomes inactive (has no listeners). Call super to invoke the onCancel callback.
Implementation
@protected
@mustCallSuper
void onInactive() {
onCancel?.call();
}