# redux-thunk-payload

> redux-thunk for redux-action，follow the flux standard

Latest version **1.0.4** (published 2019-01-07) · ISC license · 0 weekly downloads

## Install

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

## 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.4 |
| Published | 2019-01-07 |
| First published | 2018-08-31 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | dbp |
| Maintainers | dengbupapapa |
| Keywords | redux, thunk, flux, standard |

## Links

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

## 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.4 (latest) — 2019-01-07
- 1.0.3 — 2018-09-25
- 1.0.2 — 2018-08-31
- 1.0.1 — 2018-08-31
- 1.0.0 — 2018-08-31

## README

## redux-thunk-payload

#### install
```
npm install redux-thunk-payload -S
```

#### use

```
//createStore.js
import thunkMiddleware from 'redux-thunk-payload';
let applyMiddlewares = [
    thunkMiddleware,
    ...other middleware
];
let composes = [applyMiddleware(...applyMiddlewares)];
const enhancer = compose(
    ...composes
);
let store = createStore(rootReducer, mergeState, enhancer);

//action.js
export const actiontor = createActions({
    add(payload){//If we need to do this in conjunction with other actions
        return async function (dispatch){
            dispatch(actiontor.loadingStatus(true));
            let res =  await request(payload);
            dispatch(actiontor.loadingStatus(false));
            return res
        }
    },
    loadingStatus:(payload) => payload
});
```

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