onCleared
Cleans up all resources and cancels active coroutines. Must be called when the ViewModel is no longer needed to prevent memory leaks. This includes canceling timers, closing navigation connections, and clearing references.
Cleans up all resources and cancels active coroutines. Must be called when the ViewModel is no longer needed to prevent memory leaks. This includes canceling timers, closing navigation connections, and clearing references.