toSignal method

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

Convert an existing ValueListenable to ReadonlySignal

Implementation

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