toNotifierSignal method

Signal<T> toNotifierSignal({
  1. JoltDebugFn? onDebug,
})

Converts this ValueNotifier to a Signal with bidirectional sync.

Changes to either ValueNotifier or Signal are synchronized.

Parameters:

  • onDebug: Optional debug callback

Returns: A Signal synchronized with this ValueNotifier

Example:

final notifier = ValueNotifier(0);
final signal = notifier.toNotifierSignal();
notifier.value = 1; // signal.value becomes 1
signal.value = 2;   // notifier.value becomes 2

Implementation

Signal<T> toNotifierSignal({JoltDebugFn? onDebug}) {
  return ValueNotifierSignal.from(this, onDebug: onDebug);
}