Decorator to easily create debounced React inputs
npm install debounce-input-decorator> Decorator to easily create debounced React inputs
Installation of the npm package:
```
> npm install --save debounce-input-decorator
You can apply this decorator either to a DOM element or to any React component as long as it accepts onChange and value properties.
`js
import debounceDecorator from 'debounce-input-decorator'
import { Input } from 'reactstrap'
const ReactStrapInputDebounced = debounceDecorator(250)(Input)
const DomInputDebounced = debounceDecorator(250)('input')
`
Because you usually need a input or textarea, those are provided
directly:
`js
import { Input, Textarea } from 'debounce-input-decorator'
debounceTimeout={300}
// ...
/>
`
`Install dependencies
> yarn
Contributions are very welcomed, either on the documentation or on
the code.
You may:
- report any issue
you've encountered;
- fork and create a pull request.
ISC © Julien Fontanet