offAck<T extends DataObject> method

void offAck<T extends DataObject>(
  1. void callback(
    1. Acknowledged<T> data
    )
)

Removes a callback for when an Acknowledged of a DataObject of type T is received.

Implementation

void offAck<T extends DataObject>(
  void Function(Acknowledged<T> data) callback,
) {
  for (final subscription
      in _ackSubscriptions.whereType<StreamSubscription<Acknowledged<T>>>()) {
    if (subscription.onData == callback) {
      subscription.cancel();
      _ackSubscriptions.remove(subscription);
      break;
    }
  }
}