debounce-input-decorator

1.0.0 • Public • Published

debounce-input-decorator Build Status

Decorator to easily create debounced React inputs

Install

Installation of the npm package:

> npm install --save debounce-input-decorator

Usage

You can apply this decorator either to a DOM element or to any React component as long as it accepts onChange and value properties.

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:

import { Input, Textarea } from 'debounce-input-decorator'
 
<Input
  debounceTimeout={300}
  // ...
/>

Development

# Install dependencies
> yarn

# Run the tests
> yarn test

# Continuously compile
> yarn dev

# Continuously run the tests
> yarn dev-test

# Build for production (automatically called by npm install)
> yarn build

Contributions

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.

License

ISC © Julien Fontanet

/debounce-input-decorator/

    Package Sidebar

    Install

    npm i debounce-input-decorator

    Weekly Downloads

    585

    Version

    1.0.0

    License

    ISC

    Unpacked Size

    13 kB

    Total Files

    4

    Last publish

    Collaborators

    • julien-f
    • pdonias