watch method

T watch(
  1. BuildContext context
)

Subscribes the current BuildContext (widget) to this signal.

The widget will automatically rebuild whenever this signal's value changes. Returns the current value of the signal (or its scope override).

Implementation

T watch(BuildContext context) {
  final resolved = SignalScope.get(context, this);
  _watchNode(context as Element, resolved);
  return resolved.value;
}