-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial implementation extracted from Redux
- Loading branch information
0 parents
commit f8d41b0
Showing
8 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"stage": 0, | ||
"loose": "all" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"extends": "eslint-config-airbnb", | ||
"env": { | ||
"mocha": true, | ||
"node": true | ||
}, | ||
"globals": { | ||
"expect": true | ||
}, | ||
"rules": { | ||
"padded-blocks": 0, | ||
"no-use-before-define": [2, "nofunc"], | ||
"no-unused-expressions": 0 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
coverage | ||
*.log | ||
lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
language: node_js | ||
node_js: | ||
- "iojs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
redux-thunk | ||
============= | ||
|
||
Thunk [middleware](https://github.com/gaearon/redux/blob/master/docs/middleware.md) for Redux. | ||
|
||
```js | ||
npm install --save redux-thunk | ||
``` | ||
|
||
## Usage | ||
|
||
TODO | ||
|
||
## License | ||
|
||
MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"name": "redux-thunk", | ||
"version": "0.1.0", | ||
"description": "Thunk middleware for Redux.", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"prepublish": "rm -rf lib && babel src --out-dir lib" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/gaearon/redux-thunk.git" | ||
}, | ||
"homepage": "https://github.com/gaearon/redux-thunk", | ||
"keywords": [ | ||
"redux", | ||
"thunk", | ||
"middleware", | ||
"redux-middleware", | ||
"flux" | ||
], | ||
"author": "Dan Abramov <[email protected]>", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"babel": "^5.6.14", | ||
"babel-core": "^5.6.15", | ||
"babel-eslint": "^3.1.20", | ||
"eslint": "^0.24.0", | ||
"eslint-config-airbnb": "0.0.6" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export default function thunkMiddleware({ dispatch, getState }) { | ||
return next => action => | ||
typeof action === 'function' ? | ||
action(dispatch, getState) : | ||
next(action); | ||
} |