dependOnInstance method

void dependOnInstance(
  1. ReactterContext instance
)

Implementation

void dependOnInstance(ReactterContext instance) {
  void _onDidUpdate(_, __) => markNeedsBuild();

  UseEvent.withInstance(instance).on(Lifecycle.didUpdate, _onDidUpdate);

  _unsubscribersDependencies.add(
    () => UseEvent.withInstance(instance)
        .off(Lifecycle.didUpdate, _onDidUpdate),
  );
}