fn
logicAnd
v0.0.14testeddemoReactive 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? | Array<MaybeRefOrGetter<unknown>> | The boolean refs or getters to combine |
Returns
LogicAndReturnA readonly computed that is true only when every input is truthy