On this page
usePerformanceObserver
Category | Browser |
---|---|
Export Size | 536 B |
Last Changed | 2 months ago |
Observe performance metrics.
Usage
import { usePerformanceObserver } from '@vueuse/core'
const entrys = ref<PerformanceEntry[]>([])
usePerformanceObserver({
entryTypes: ['paint'],
}, (list) => {
entrys.value = list.getEntries()
})
Type Declarations
export type UsePerformanceObserverOptions = PerformanceObserverInit &
ConfigurableWindow & {
/**
* Start the observer immediate.
*
* @default true
*/
immediate?: boolean
}
/**
* Observe performance metrics.
*
* @see https://vueuse.org/usePerformanceObserver
* @param options
*/
export declare function usePerformanceObserver(
options: UsePerformanceObserverOptions,
callback: PerformanceObserverCallback
): {
isSupported: ComputedRef<boolean>
start: () => void
stop: () => void
}
Source
© 2019-present Anthony Fu
Licensed under the MIT License.
https://vueuse.org/core/usePerformanceObserver/