# redux-delayed-dispatch

> Delayed Dispatch is setTimeout/clearTimeout but in middleware form with some small enhancements.

Latest version **1.0.0-0** (published 2016-11-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install redux-delayed-dispatch
pnpm add redux-delayed-dispatch
yarn add redux-delayed-dispatch
bun add redux-delayed-dispatch
```

## 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.0-0 |
| Published | 2016-11-22 |
| First published | 2016-11-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | beaucollins |

## Links

- npm: https://www.npmjs.com/package/redux-delayed-dispatch
- npm.io page: https://npm.io/package/redux-delayed-dispatch

## Recent versions

- 1.0.0-0 (latest) — 2016-11-22
- 1.0.0-2 (alpha) — 2016-11-22
- 1.0.0-1 — 2016-11-22

## README

# Redux Delayed Dispatch

Delayed Dispatch is setTimeout/clearTimeout but in middleware form with some small enhancements.

## Install and setup

1. `npm install redux-delayed-dispatch`
2. Add the store enhancer using `applyMiddleware`:

Example:

```javascript
// import middleware
import delayedDispatch from 'redux-delayed-dispatch';

// use middleware in your store
createStore( reducer, applyMiddleware( delayedDispatch ) );
```

## Using

For basic actions where the keys and values of the redux action or primitives (excluding `object`, `array`, and `function` )

```javascript
import { delayAction, cancelAction } from 'redux-delayed-dispatch';

const myAction = ( param ) => ( { type: 'ACTION_TYPE', param } );

// delays myAction for 100 ms
const { id, cancel } = dispatch( delayAction( myAction, 100 ) );
if ( shouldCancelTimer ) {
	// myAction will not be dispatched
	dispatch( cancel );
}
```

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