source: node_modules/redux-thunk/dist/redux-thunk.mjs

Last change on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 417 bytes
Line 
1// src/index.ts
2function 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}
11var thunk = createThunkMiddleware();
12var withExtraArgument = createThunkMiddleware;
13export {
14 thunk,
15 withExtraArgument
16};
Note: See TracBrowser for help on using the repository browser.