# or

`function` in `seedcord` · v0.14.0

<https://docs.seedcord.org/packages/seedcord/0.14.0/functions/or>

Runs each gate in order and passes on the first arm that passes. Takes two or more arms. The required context is the union of the arms, so a handler that matches any one arm fits. When every arm refuses it throws the trailing [`OrOptions`](/packages/seedcord/0.14.0/interfaces/or-options) `fail` if given, else an auto list of the arms derived from the summary field, else a default refusal. The trailing options object does not count as an arm.

## Signature 1

```ts
or<Gates>(
    gates: Gates
): Gate<
    RequiredOf<Gates[number]>,
    JoinNames<Gates, " | ">
>
```

Runs each gate in order and passes on the first arm that passes. Takes two or more arms. The required context is the union of the arms, so a handler that matches any one arm fits. When every arm refuses it throws the trailing [`OrOptions`](/packages/seedcord/0.14.0/interfaces/or-options) `fail` if given, else an auto list of the arms derived from the summary field, else a default refusal. The trailing options object does not count as an arm.

Parameters.

- `gates` `Gates` — The gate arms to try in order, with an optional trailing [`OrOptions`](/packages/seedcord/0.14.0/interfaces/or-options) object.

Returns `Gate<RequiredOf<Gates[number]>, JoinNames<Gates, ' | '>>`.

## Signature 2

```ts
or<Gates>(
    args: [...Gates, OrOptions]
): Gate<
    RequiredOf<Gates[number]>,
    JoinNames<Gates, " | ">
>
```

Parameters.

- `args` `[...Gates, OrOptions]`

Returns `Gate<RequiredOf<Gates[number]>, JoinNames<Gates, ' | '>>`.
