Skip to content

⬅️ Back to Table of Contents

📄 usePrevious

📊 Analysis Summary

Metric Count
🔧 Functions 1
📦 Imports 6
🟢 Vue Composition API 1

📚 Table of Contents

🛠️ File Location:

📂 packages/core/usePrevious/index.ts

📦 Imports

Name Source
MaybeRefOrGetter vue
ShallowRef vue
toRef @vueuse/shared
deepReadonly vue
shallowRef vue
watch vue

Vue Composition API

Name Type Reactive Variables Composables
watch watch none none

Functions

usePrevious(value: MaybeRefOrGetter<T>): Readonly<ShallowRef<T | undefined>>

Holds the previous value of a ref.

See: https

Raw JSDoc
/**
 * Holds the previous value of a ref.
 *
 * @see   {@link https://vueuse.org/usePrevious}
 */
Code
export function usePrevious<T>(value: MaybeRefOrGetter<T>): Readonly<ShallowRef<T | undefined>>

Generated by Syntax Scribe