unwatchSignal<T> function

void unwatchSignal<T>(
  1. BuildContext context,
  2. ReadonlySignal<T> signal
)

Remove all subscribers for a given signal for watchers

Implementation

void unwatchSignal<T>(BuildContext context, ReadonlySignal<T> signal) {
  if (context is Watch) return;
  final key = context.hashCode;
  _elementRefs[key]?.unwatch(signal);
}