Skip to content

"FailWhen" to drop out if a certain condition is met #27

@sameera

Description

@sameera

It is quite common to be writing code that looks like:

getSomething()
  .Map(something => {
    if (!someCondition(something)) {
     return Outcome<Something>.Reject("Description of failure");
    }
    return doSomething(something);
}

FailWhen will simplify this to:

getSomething()
  .FailWhen(something => !someCondition(something), "Description of failure");
  .Map(something => doSomething(something));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions