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/createProjection.md
1---2category: '@Math'3related: useProjection, createGenericProjection4---56# createProjection78Reactive numeric projection from one domain to another.910## Usage1112```ts13import { createProjection } from '@vueuse/math'1415const useProjector = createProjection([0, 10], [0, 100])16const input = ref(0)17const projected = useProjector(input) // projected.value === 01819input.value = 5 // projected.value === 5020input.value = 10 // projected.value === 10021```2223## Type Declarations2425```ts26export declare function createProjection(27fromDomain: MaybeRefOrGetter<readonly [number, number]>,28toDomain: MaybeRefOrGetter<readonly [number, number]>,29projector?: ProjectorFunction<number, number>,30): UseProjection<number, number>31```32