redux-thunks
Advanced tools
Comparing version 0.3.1 to 1.0.0
{ | ||
"name": "redux-thunks", | ||
"version": "0.3.1", | ||
"version": "1.0.0", | ||
"description": "Thunk creator for redux", | ||
@@ -44,2 +44,5 @@ "main": "cjs/index.js", | ||
"dependencies": {}, | ||
"peerDependencies": { | ||
"redux-thunk": "^2.2.0" | ||
}, | ||
"devDependencies": { | ||
@@ -46,0 +49,0 @@ "ava": "^0.21.0", |
# redux-thunks | ||
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/w33ble/redux-thunks/master/LICENSE) | ||
[![Build Status](https://travis-ci.org/w33ble/redux-thunks.svg?branch=master)](https://travis-ci.org/w33ble/redux-thunks) | ||
[![Build Status](https://img.shields.io/travis/w33ble/redux-thunks.svg?branch=master)](https://travis-ci.org/w33ble/redux-thunks) | ||
[![Coverage](https://img.shields.io/codecov/c/github/w33ble/redux-thunks.svg)](https://codecov.io/gh/w33ble/redux-thunks) | ||
[![npm](https://img.shields.io/npm/v/redux-thunks.svg)](https://www.npmjs.com/package/redux-thunks) | ||
![Project Status](https://img.shields.io/badge/status-experimental-orange.svg) | ||
![Project Status](https://img.shields.io/badge/status-stable-brightgreen.svg) | ||
Simple thunk creator for redux. | ||
This is meant to smooth over the use of [redux-thunk](https://github.com/gaearon/redux-thunk) mixed with the use of [redux-actions](https://github.com/acdlite/redux-actions). | ||
This is meant to smooth over the use of [redux-thunk](https://github.com/gaearon/redux-thunk) and [redux-actions](https://github.com/acdlite/redux-actions). | ||
@@ -16,3 +16,3 @@ ## Installation | ||
``` | ||
$ yarn add redux-thunks | ||
$ yarn add redux-thunks redux-thunk | ||
``` | ||
@@ -23,3 +23,3 @@ | ||
``` | ||
$ npm install --save redux-thunks | ||
$ npm install --save redux-thunks redux-thunk | ||
``` | ||
@@ -29,4 +29,18 @@ | ||
Best used along side `redux-actions`. | ||
This module is simply syntactic sugar for using `redux-thunk` with `redux-actions`. As such, it requires that you use the [redux-thunk](https://www.npmjs.com/package/redux-thunk) middleware. | ||
### Add redux-thunk middleware | ||
```js | ||
import { createStore, applyMiddleware } from 'redux'; | ||
import thunk from 'redux-thunk'; | ||
import rootReducer from './reducers/index'; | ||
// Note: this API requires redux@>=3.1.0 | ||
const store = createStore( | ||
rootReducer, | ||
applyMiddleware(thunk) | ||
); | ||
``` | ||
### Action definition | ||
@@ -33,0 +47,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
8035
0
104
1