onSuccess method

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

Implementation

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