|
Last change
on this file since a762898 was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
417 bytes
|
| Rev | Line | |
|---|
| [a762898] | 1 | // src/index.ts
|
|---|
| 2 | function createThunkMiddleware(extraArgument) {
|
|---|
| 3 | const middleware = ({ dispatch, getState }) => (next) => (action) => {
|
|---|
| 4 | if (typeof action === "function") {
|
|---|
| 5 | return action(dispatch, getState, extraArgument);
|
|---|
| 6 | }
|
|---|
| 7 | return next(action);
|
|---|
| 8 | };
|
|---|
| 9 | return middleware;
|
|---|
| 10 | }
|
|---|
| 11 | var thunk = createThunkMiddleware();
|
|---|
| 12 | var withExtraArgument = createThunkMiddleware;
|
|---|
| 13 | export {
|
|---|
| 14 | thunk,
|
|---|
| 15 | withExtraArgument
|
|---|
| 16 | };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.