onAck<T extends DataObject> method
Registers a callback for when an Acknowledged of a DataObject of type
T
is received.
Implementation
void onAck<T extends DataObject>(
void Function(Acknowledged<T> data) callback,
) {
_ackSubscriptions.add(
acknowledgedPackets
.where((ack) => ack.object is T)
.map((ack) => ack.cast<T>())
.listen(callback),
);
}