operator | method

Spec<T> operator |(
  1. Spec<T> other
)

Combines this spec with another using OR logic (|).

Returns a new spec that is satisfied when at least one of this spec or other is satisfied. Use this when multiple alternatives are acceptable. Shorthand for calling or.

Example:

// Any one condition satisfies
final canEdit = IsAdmin() | IsAuthor() | IsModerator();

Implementation

Spec<T> operator |(Spec<T> other) => _Or(this, other);