Signal<T> constructor

Signal<T>(
  1. T internalValue, {
  2. String? debugLabel,
  3. bool autoDispose = false,
})

Simple writeable signal.

final count = signal(0);
print(count.value); // 0
count.value++;
print(count.value); // 1

Implementation

Signal(
  super.internalValue, {
  this.debugLabel,
  bool autoDispose = false,
}) {
  this.autoDispose = autoDispose;
  afterCreate(super.internalValue);
}