usePerformanceObserver ​
sensors
test coverage
Last changed: 8 days ago
TIP
This hook uses PerformanceObserver browser api to provide enhanced functionality. Make sure to check for compatibility with different browsers when using this api
Hook that allows you to observe performance entries
typescript
import { usePerformanceObserver } from '@siberiacancode/reactuse';
Usage ​
typescript
const { supported, entries, start, stop } = usePerformanceObserver();
Demo ​
Api ​
Parameters
Name | Type | Default | Note |
---|---|---|---|
options | UsePerformanceObserverOptions | - | The options for the performance observer |
callback | PerformanceObserverCallback | - | The function to handle performance entries |
Returns
object