R
fn

logicOr

v0.0.15testeddemo

Reactively 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); // true
ts
const valid = ref(false);
const result = logicOr(valid, () => Date.now() > 0); // true

Demo

Loading demo…

Signature

ts
export function logicOr(...args: LogicOrSource[]): ComputedRef<boolean>{ ... }

Parameters

ParameterTypeDescription
args?unknown[]The boolean sources to combine

Returns

ComputedRef<boolean>A computed ref that is `true` when any source is truthy