Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[yak_runner] runBypassAsync should take a FutureOr returning function #250

Closed
iapicca opened this issue May 5, 2024 · 0 comments · Fixed by #251
Closed

[yak_runner] runBypassAsync should take a FutureOr returning function #250

iapicca opened this issue May 5, 2024 · 0 comments · Fixed by #251

Comments

@iapicca
Copy link
Collaborator

iapicca commented May 5, 2024

extension RunBypassAsyncX<S extends Object> on FutureResult<S> {
  FutureResult<S> runBypassAsync(
--    UnaryAsync<void, S> function,
  ) async {
    final result = await this;
    if (result.isSuccess) {
      final bypass = await function.runVoidAsync(result.asSuccess);
      if (bypass.isFailure) {
        return bypass.asFailure.recast();
      }
    }
    return result;
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant