# redux-payload

> Higher-order Redux reducer which returns payload for specific actions

Latest version **0.1.5** (published 2016-08-01) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.5 |
| Published | 2016-08-01 |
| First published | 2016-07-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | cyberint |

## Links

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

## Recent versions

- 0.1.5 (latest) — 2016-08-01
- 0.1.4 — 2016-07-12
- 0.1.3 — 2016-07-11
- 0.1.2 — 2016-07-11
- 0.1.1 — 2016-07-11

## README

# redux-payload
Higher-order Redux reducer which returns payload for specific actions

## Usage

### Install via NPM

```
npm install redux-payload --save
```

### Import

```javascript
import payload from 'redux-payload'; 
// or
var payload = require('redux-payload');
```

#### If you need ES6 module
```javascript
import payload from 'redux-payload/es6';
```
Use this if you are using [rollup.js](http://rollupjs.org/) or
[webpack 2](http://webpack.github.io/docs/changelog.html#2-1-x-beta), or any
ES2015 modules-compatible bundler which can eliminate unused library code with
[tree-shaking](http://www.2ality.com/2015/12/webpack-tree-shaking.html).

It is recommended to import the library from `redux-payload/es6` instead of
`redux-payload/src` because the source code depends on experimental presets from
babel (stage 1-3) and may be incompatible with your bundler or settings.

### Other environments

Use the Universal Module Definition (UMD)

- [payload.js](dist/payload.js)
- [payload.min.js](dist/payload.min.js) (minified)

## API

```js
payload(
  actionType: String,
  mapResult: ?(resultBefore: any) => resultAfter
): (reducer) => reducer
```

Creates a higher-order reducer which returns the payload of the action
for the given action type. Before returning it maps the payload with `mapResult`
function, which is useful when you deal with immutable data structures in your store.

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