Skip to content

A react hook that provides value debouncing using requestAnimationFrame.

Notifications You must be signed in to change notification settings

mlynarczyk/use-raf-debounced-value

Repository files navigation

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;
};

About

A react hook that provides value debouncing using requestAnimationFrame.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published