beautiful-react-hooks
Version:
A collection of beautiful (and hopefully useful) React hooks to speed-up your components and hooks development
12 lines (11 loc) • 499 B
TypeScript
import { CallbackSetter, GenericFunction } from './shared/types';
export declare type UseRequestAnimationFrameOpts = {
increment?: number;
startAt?: number;
finishAt?: number;
};
/**
* Takes care of running an animating function, provided as the first argument, while keeping track of its progress.
*/
declare const useRequestAnimationFrame: <T extends GenericFunction>(func: T, options?: UseRequestAnimationFrameOpts) => CallbackSetter<void>;
export default useRequestAnimationFrame;