Skip to content

usePerformanceObserver ​

Hook that allows you to observe performance entries

sensors
low
test coverage
Last changed: 8 days ago

Installation ​

Library
CLI
Manual
typescript
import { usePerformanceObserver } from '@siberiacancode/reactuse';

Usage ​

typescript
const { supported, entries, start, stop } = usePerformanceObserver();

Demo ​

Api ​

Parameters

NameTypeDefaultNote
optionsUsePerformanceObserverOptions-The options for the performance observer
callbackPerformanceObserverCallback-The function to handle performance entries

Returns

object

Type declaration ​

typescript
export type UsePerformanceObserverOptions = PerformanceObserverInit & {
  /** Whether to start the observer immediately */
  immediate?: boolean;
};

Source ​

Source • Demo

Contributors ​

D
debabin
debabin

Released under the MIT License.