Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Apply VueUse composables in Vue 3/Nuxt projects to replace custom implementations with battle-tested utilities.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/useProjection.md
1---2category: '@Math'3related: createGenericProjection4---56# useProjection78Reactive numeric projection from one domain to another.910## Usage1112```ts13import { useProjection } from '@vueuse/math'1415const input = ref(0)16const projected = useProjection(input, [0, 10], [0, 100])1718input.value = 5 // projected.value === 5019input.value = 10 // projected.value === 10020```2122## Type Declarations2324```ts25/**26* Reactive numeric projection from one domain to another.27*28* @see https://vueuse.org/useProjection29*30* @__NO_SIDE_EFFECTS__31*/32export declare function useProjection(33input: MaybeRefOrGetter<number>,34fromDomain: MaybeRefOrGetter<readonly [number, number]>,35toDomain: MaybeRefOrGetter<readonly [number, number]>,36projector?: ProjectorFunction<number, number>,37): ComputedRef<number>38```39