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/useMemory.md
1---2category: Browser3---45# useMemory67Reactive Memory Info.89## Usage1011```ts12import { useMemory } from '@vueuse/core'1314const { isSupported, memory } = useMemory()15```1617## Type Declarations1819```ts20/**21* Performance.memory22*23* @see https://developer.mozilla.org/en-US/docs/Web/API/Performance/memory24*/25export interface MemoryInfo {26/**27* The maximum size of the heap, in bytes, that is available to the context.28*/29readonly jsHeapSizeLimit: number30/**31* The total allocated heap size, in bytes.32*/33readonly totalJSHeapSize: number34/**35* The currently active segment of JS heap, in bytes.36*/37readonly usedJSHeapSize: number38[Symbol.toStringTag]: "MemoryInfo"39}40export interface UseMemoryOptions extends ConfigurableScheduler {41/**42* Start the timer immediately43*44* @deprecated Please use `scheduler` option instead45* @default true46*/47immediate?: boolean48/**49* Execute the callback immediately after calling `resume`50*51* @deprecated Please use `scheduler` option instead52* @default false53*/54immediateCallback?: boolean55/** @deprecated Please use `scheduler` option instead */56interval?: number57}58export interface UseMemoryReturn extends Supportable {59memory: Ref<MemoryInfo | undefined>60}61/**62* Reactive Memory Info.63*64* @see https://vueuse.org/useMemory65* @param options66*67* @__NO_SIDE_EFFECTS__68*/69export declare function useMemory(options?: UseMemoryOptions): UseMemoryReturn70```71