0.1.5 • Published 8 years ago

redux-payload v0.1.5

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

redux-payload

Higher-order Redux reducer which returns payload for specific actions

Usage

Install via NPM

npm install redux-payload --save

Import

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

If you need ES6 module

import payload from 'redux-payload/es6';

Use this if you are using rollup.js or webpack 2, or any ES2015 modules-compatible bundler which can eliminate unused library code with tree-shaking.

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)

API

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.

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago