You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							1 lines
						
					
					
						
							3.5 KiB
						
					
					
				
			
		
		
	
	
							1 lines
						
					
					
						
							3.5 KiB
						
					
					
				| {"ast":null,"code":"/** A function that accepts a potential \"extra argument\" value to be injected later,\r\n * and returns an instance of the thunk middleware that uses that value\r\n */\nfunction createThunkMiddleware(extraArgument) {\n  // Standard Redux middleware definition pattern:\n  // See: https://redux.js.org/tutorials/fundamentals/part-4-store#writing-custom-middleware\n  var middleware = function middleware(_ref) {\n    var dispatch = _ref.dispatch,\n        getState = _ref.getState;\n    return function (next) {\n      return function (action) {\n        // The thunk middleware looks for any functions that were passed to `store.dispatch`.\n        // If this \"action\" is really a function, call it and return the result.\n        if (typeof action === 'function') {\n          // Inject the store's `dispatch` and `getState` methods, as well as any \"extra arg\"\n          return action(dispatch, getState, extraArgument);\n        } // Otherwise, pass the action down the middleware chain as usual\n\n\n        return next(action);\n      };\n    };\n  };\n\n  return middleware;\n}\n\nvar thunk = createThunkMiddleware(); // Attach the factory function so users can create a customized version\n// with whatever \"extra arg\" they want to inject into their thunks\n\nthunk.withExtraArgument = createThunkMiddleware;\nexport default thunk;","map":{"version":3,"names":["createThunkMiddleware","extraArgument","middleware","_ref","dispatch","getState","next","action","thunk","withExtraArgument"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/node_modules/redux-thunk/es/index.js"],"sourcesContent":["/** A function that accepts a potential \"extra argument\" value to be injected later,\r\n * and returns an instance of the thunk middleware that uses that value\r\n */\nfunction createThunkMiddleware(extraArgument) {\n  // Standard Redux middleware definition pattern:\n  // See: https://redux.js.org/tutorials/fundamentals/part-4-store#writing-custom-middleware\n  var middleware = function middleware(_ref) {\n    var dispatch = _ref.dispatch,\n        getState = _ref.getState;\n    return function (next) {\n      return function (action) {\n        // The thunk middleware looks for any functions that were passed to `store.dispatch`.\n        // If this \"action\" is really a function, call it and return the result.\n        if (typeof action === 'function') {\n          // Inject the store's `dispatch` and `getState` methods, as well as any \"extra arg\"\n          return action(dispatch, getState, extraArgument);\n        } // Otherwise, pass the action down the middleware chain as usual\n\n\n        return next(action);\n      };\n    };\n  };\n\n  return middleware;\n}\n\nvar thunk = createThunkMiddleware(); // Attach the factory function so users can create a customized version\n// with whatever \"extra arg\" they want to inject into their thunks\n\nthunk.withExtraArgument = createThunkMiddleware;\nexport default thunk;"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,qBAAT,CAA+BC,aAA/B,EAA8C;EAC5C;EACA;EACA,IAAIC,UAAU,GAAG,SAASA,UAAT,CAAoBC,IAApB,EAA0B;IACzC,IAAIC,QAAQ,GAAGD,IAAI,CAACC,QAApB;IAAA,IACIC,QAAQ,GAAGF,IAAI,CAACE,QADpB;IAEA,OAAO,UAAUC,IAAV,EAAgB;MACrB,OAAO,UAAUC,MAAV,EAAkB;QACvB;QACA;QACA,IAAI,OAAOA,MAAP,KAAkB,UAAtB,EAAkC;UAChC;UACA,OAAOA,MAAM,CAACH,QAAD,EAAWC,QAAX,EAAqBJ,aAArB,CAAb;QACD,CANsB,CAMrB;;;QAGF,OAAOK,IAAI,CAACC,MAAD,CAAX;MACD,CAVD;IAWD,CAZD;EAaD,CAhBD;;EAkBA,OAAOL,UAAP;AACD;;AAED,IAAIM,KAAK,GAAGR,qBAAqB,EAAjC,C,CAAqC;AACrC;;AAEAQ,KAAK,CAACC,iBAAN,GAA0BT,qBAA1B;AACA,eAAeQ,KAAf"},"metadata":{},"sourceType":"module"} |