onSuccess method

Future<NEResult<T>> onSuccess(
  1. FutureOr action(
    1. T
    )
)

Implementation

Future<NEResult<T>> onSuccess(FutureOr Function(T) action) {
  return then<NEResult<T>>((value) async {
    if (value.isSuccess()) {
      try {
        await action(value.nonNullData);
      } catch (e, _) {
        assert(() {
          throw e;
        }());
      }
    }
    return value;
  });
}