onChange method

void onChange(
  1. void callback(
    1. T value
    ), {
  2. bool fireImmediately = false,
  3. DspReg? disposers,
})

Implementation

void onChange(
  void Function(T value) callback, {
  bool fireImmediately = false,
  DspReg? disposers,
}) {
  if (fireImmediately) {
    fr(
      () {
        callback(watch());
      },
      disposers: disposers,
    );
  } else {
    onChange(
      callback.skip(1),
      fireImmediately: true,
      disposers: disposers,
    );
  }
}