on<T> method

void on<T>(
  1. AirPulse<T> signal,
  2. void handler(
    1. T data, {
    2. void onError(
      1. String error
      )?,
    3. VoidCallback? onSuccess,
    })
)

Register a handler for a strictly typed AirSignal

Implementation

void on<T>(
  AirPulse<T> signal,
  void Function(
    T data, {
    VoidCallback? onSuccess,
    void Function(String error)? onError,
  })
  handler,
) {
  onRaw<T>(signal.name, handler);
}