runIfSuccessAsync<X> method

Future<X?> runIfSuccessAsync<X>(
  1. Future<X> block(
    1. T
    )
)

Executes given block if this data is SuccessData

Implementation

Future<X?> runIfSuccessAsync<X>(Future<X> Function(T) block) async {
  if (this is SuccessData) {
    return block(unwrap());
  }

  return null;
}