# redux-debounce

> FSA-compliant middleware for Redux to debounce actions.

Latest version **1.0.1** (published 2016-04-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install redux-debounce
pnpm add redux-debounce
yarn add redux-debounce
bun add redux-debounce
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2016-04-18 |
| First published | 2015-12-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.12.0 |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 83 |
| Author | Neil Kistner |
| Maintainers | wyze |
| Keywords | redux, debounce, middleware, redux-middleware, fsa, flux |

## Links

- npm: https://www.npmjs.com/package/redux-debounce
- Repository: https://github.com/wyze/redux-debounce
- Homepage: https://github.com/wyze/redux-debounce#readme
- Issues: https://github.com/wyze/redux-debounce/issues
- npm.io page: https://npm.io/package/redux-debounce

## Dependencies (3)

- [lodash.debounce](https://npm.io/package/lodash.debounce.md) ^4.0.6
- [lodash.mapvalues](https://npm.io/package/lodash.mapvalues.md) ^4.3.0
- [flux-standard-action](https://npm.io/package/flux-standard-action.md) ^0.6.1

## Alternatives

- [@reckona/mreact-store](https://npm.io/package/@reckona/mreact-store.md) — 976 weekly downloads
- [regular-state](https://npm.io/package/regular-state.md) — 410 weekly downloads
- [@pacote/flux-actions](https://npm.io/package/@pacote/flux-actions.md) — 65 weekly downloads
- [@pilotlab/lux-debug](https://npm.io/package/@pilotlab/lux-debug.md) — 39 weekly downloads
- [vue-persist-state](https://npm.io/package/vue-persist-state.md) — 19 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2016-04-18
- 1.0.0 — 2015-12-05

## README

# redux-debounce

[![Build Status][travis-image]][travis-url]
[![npm][npm-image]][npm-url]
[![Codecov.io][codecov-image]][codecov-url]

> FSA-compliant middleware for Redux to debounce actions.

## Installation

```sh
$ npm install --save redux-debounce
```

## Usage

```javascript
// Store setup
import { applyMiddleware, createStore } from 'redux'
import createDebounce from 'redux-debounce'
import createLogger from 'redux-logger'
import promise from 'redux-promise'
import thunk from 'redux-thunk'

const config = {
  simple: 300
}

const debouncer = createDebounce(config)
const logger = createLogger()
const createMiddleware = applyMiddleware(thunk, debouncer, promise, thunk)
const store = createMiddleware(createStore)(reducer)

const debounceAction = () => ({
  meta: {
    debounce: 'simple',
  },
  type: 'TEST',
})
```

Debounce middleware **should be** placed near the top of the chain.

### Example

See the example directory.

```sh
$ cd example
$ npm install
$ npm start
```

## API

`redux-debounce` exposes single constructor function for creating debounce middleware.

> createDebounce( options: Object )

### Options

> **Each option is a property to setup different debounces for different actions.**

#### Number

Number of milliseconds to debounce the action for.

#### Object

##### wait (Number)

Number of milliseconds to debounce the action for.

##### maxWait (Number)

Maximum number of milliseconds before the action is called.

See [lodash][lodash-url] for the rest of the supported options.

## License

Copyright © 2015-2016 [Neil Kistner](//github.com/wyze)

Released under the MIT license. See [license](license) for details.

[lodash-url]: https://lodash.com/docs#debounce

[travis-image]: https://img.shields.io/travis/wyze/redux-debounce.svg?style=flat-square
[travis-url]: https://travis-ci.org/wyze/redux-debounce

[npm-image]: https://img.shields.io/npm/v/redux-debounce.svg?style=flat-square
[npm-url]: https://npmjs.com/package/redux-debounce

[codecov-image]: https://img.shields.io/codecov/c/github/wyze/redux-debounce.svg?style=flat-square
[codecov-url]: https://codecov.io/github/wyze/redux-debounce

---
_Source: https://npm.io/package/redux-debounce · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
