Skip to content

Latest commit

 

History

History
31 lines (21 loc) · 519 Bytes

README.md

File metadata and controls

31 lines (21 loc) · 519 Bytes

useRafDebouncedValue react hook

A react hook that provides value debouncing using requestAnimationFrame.

Installation

Yarn:

yarn add use-raf-debounced-value

Npm:

npm i use-raf-debounced-value --save

Usage

import { useRafDebouncedValue } from 'use-raf-debounced-value';
import { useExampleHook } from 'example';

export const useDebouncedExampleHook = () => {
  const value = useExampleHook();
  const [debouncedValue] = useRafDebouncedValue(value);

  return debouncedValue;
};