toSignal method

Signal<T> toSignal({
  1. String? debugLabel,
})

Convert an existing ValueNotifier to Signal

Implementation

Signal<T> toSignal({String? debugLabel}) {
  final s = signal<T>(value, debugLabel: debugLabel);
  addListener(() => s.value = value);
  s.subscribe((_) => value = s.value);
  return s;
}