dispose method

dynamic dispose()

Call when this hook is no longer needed.

Implementation

dispose() {
  UseEvent<T>(id).off(Lifecycle.initialized, _onInstance);
  UseEvent<T>(id).off(Lifecycle.willMount, _onInstance);
  UseEvent<T>(id).off(Lifecycle.destroyed, _onInstance);

  _instance = null;
  _isDisposed = true;
}