Skip to content
On this page

logicAnd

Category
Export Size
204 B
Package
@vueuse/math
Last Changed
6 months ago
Alias
and
Related

AND condition for refs.

Usage

ts
import { logicAnd } from '@vueuse/math'
import { whenever } from '@vueuse/core'

const a = ref(true)
const b = ref(false)

whenever(logicAnd(a, b), () => {
  console.log('both a and b are now truthy!')
})
import { logicAnd } from '@vueuse/math'
import { whenever } from '@vueuse/core'

const a = ref(true)
const b = ref(false)

whenever(logicAnd(a, b), () => {
  console.log('both a and b are now truthy!')
})

Type Declarations

typescript
/**
 * `AND` conditions for refs.
 *
 * @see https://vueuse.org/logicAnd
 */
export declare function logicAnd(
  ...args: MaybeComputedRef<any>[]
): ComputedRef<boolean>
export { logicAnd as and }
/**
 * `AND` conditions for refs.
 *
 * @see https://vueuse.org/logicAnd
 */
export declare function logicAnd(
  ...args: MaybeComputedRef<any>[]
): ComputedRef<boolean>
export { logicAnd as and }

Source

SourceDocs

Contributors

Curt Grimes
Anthony Fu

Changelog

v8.9.1 on 7/8/2022
1a4e0 - feat(math)!: move logicAnd, logicOr, logicNot to @vueuse/math (#1794)
a9ccc - feat(all): use MaybeComputedRef (#1768)

Released under the MIT License.