Skip to content

logicAnd

Category
Export Size
66 B
Package
@reause/math
Last Changed
5 days ago
Related

AND condition for values

Demo

Usage

tsx
import { 
logicAnd
} from '@reause/math'
const
both
=
logicAnd
(true, false) // false
const
all
=
logicAnd
(true, false, 1) // false
const
every
=
logicAnd
(true, 1, 'foo') // true

Arguments are plain read-only values (upstream takes MaybeRefOrGetter<any>[]). The result is re-evaluated on every call — there is no reactivity, so re-renders drive re-evaluation.

Type Declarations

ts
export function logicAnd(...args: any[]): boolean

Source

Source · Demo · VueUse

Contributors

hairyf

Changelog

v0.1.0 on
7ac2f - fix(math): resolve logicAnd audit findings (#777)
8b845 - feat(math): add logicAnd (#28)

Released under the MIT License. v0.1.8