fn
logicAnd
v0.0.15testeddemoReactive 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 === falsets
const isReady = ref(true);
const hasAccess = computed(() => true);
const canProceed = logicAnd(isReady, hasAccess, () => true);
// canProceed.value === trueDemo
Loading demo…
Signature
ts
export function logicAnd(...args: Array<MaybeRefOrGetter<unknown>>): LogicAndReturn{ ... }Parameters
| Parameter | Type | Description |
|---|---|---|
args? | unknown[] | The boolean refs or getters to combine |
Returns
LogicAndReturnA readonly computed that is `true` only when every input is truthy