fn
logicOr
v0.0.14testeddemoReactively compute the logical OR across a list of boolean
sources (each a ref, getter, or raw value). Returns a ComputedRef<boolean>
that is true when at least one source is truthy. Short-circuits on the first
truthy source, so later refs are only read when needed. With no arguments the
result is false (the identity for OR). Fully SSR-safe — touches no globals.
Examples
ts
const a = ref(false);
const b = ref(true);
const either = logicOr(a, b); // truets
const valid = ref(false);
const result = logicOr(valid, () => Date.now() > 0); // trueDemo
Loading demo…
Signature
ts
export function logicOr(...args: LogicOrSource[]): ComputedRef<boolean>{ ... }Parameters
| Parameter | Type | Description |
|---|---|---|
args? | LogicOrSource[] | The boolean sources to combine |
Returns
ComputedRef<boolean>A computed ref that is true when any source is truthy