# redux-thunk-catch

> Thunk middleware alternative for Redux, with error handling support.

Latest version **1.0.0** (published 2017-09-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install redux-thunk-catch
pnpm add redux-thunk-catch
yarn add redux-thunk-catch
bun add redux-thunk-catch
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2017-09-20 |
| First published | 2017-09-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Shoaib Kalsekar |
| Maintainers | shoaib.kalsekar |
| Keywords | redux, thunk, middleware, redux-middleware, flux, error, handler, catch |

## Links

- npm: https://www.npmjs.com/package/redux-thunk-catch
- Repository: https://github.com/shoaibkalsekar/redux-thunk-catch
- Issues: https://github.com/shoaibkalsekar/redux-thunk-catch/issues
- npm.io page: https://npm.io/package/redux-thunk-catch

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2017-09-20

## README

# Redux Thunk with catch support
A redux thunk alternative with error handling support.

### Install:
```
npm i --save redux-thunk-catch
```

### Usage

**Import**
_Note: You are importing a function, that creates thunk middleware, not the thunk middleware itself._
```
import createThunk from 'redux-thunk-catch';
```

**Create a error reporting function**
```
const reportError = (err, state, action, dispatch) => {
  crashReporter.capture(err, {
    state,
    action
  });
}
```

**Pass error reporting function to createThunk**
```
const thunk = createThunk(reportError)
```

Now thunk can be used as any other middleware, using applyMiddleware(). You can read the [documentation](https://github.com/gaearon/redux-thunk) for thunk for its detailed usage.

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