R
fn

logicAnd

v0.0.15testeddemo

Reactive logical `AND` across boolean refs or getters. The result is `true` only when every input resolves to a truthy value.

Examples

ts
const a = ref(true);
const b = ref(false);
const all = logicAnd(a, b);
// all.value === false
ts
const isReady = ref(true);
const hasAccess = computed(() => true);
const canProceed = logicAnd(isReady, hasAccess, () => true);
// canProceed.value === true

Demo

Loading demo…

Signature

ts
export function logicAnd(...args: Array<MaybeRefOrGetter<unknown>>): LogicAndReturn{ ... }

Parameters

ParameterTypeDescription
args?unknown[]The boolean refs or getters to combine

Returns

LogicAndReturnA readonly computed that is `true` only when every input is truthy