npm.io
0.0.1-beta.22 • Published 5 years ago

hook-book

Licence
ISC
Version
0.0.1-beta.22
Deps
1
Size
50 kB
Vulns
0
Weekly
0
Stars
3

HookBook

npm version npm downloads npm downloads

A collection of React Hook recipes.

Recipes

Recipe Description
useDebounce A hook for debouncing the updates of a value, only using the trailing update.
useDrag A hook to make dragging elements easier.
useKeypress A hook to detect when the specific keys are pressed.
useThrottle A hook for throttling the updates of a value.

Installation

HookBook is supported in projects that are using the latest versions of React (16.8.0+). To install, run the following command from your CLI.

$ npm install hook-book

Sample Usage

import useKeyPress from 'hook-book/use-keypress'

const Component = () => {
    const keysPressed = useKeyPress()
    return (...)
}

Keywords