performCancellableAsyncOperation<T> method
Performs an asynchronous operation and cancels it if the BloC is closed.
Implementation
@protected
Future<T?> performCancellableAsyncOperation<T>(Future<T> opreation) {
if (shouldProcessEventInOrder()) {
return opreation;
}
var cancellableOperation = CancelableOperation<T>.fromFuture(opreation);
cancelableOperations.add(cancellableOperation);
return cancellableOperation.valueOrCancellation();
}