0

I am new to react and redux, try to understand in redux middleware, From where the action parameter came?

const loggerMiddleware = ({dispatch, getState}) => (next) => (action) => {
  console.log("Logger Middleware");
  if(typeof action !== 'function'){
    console.log("Action type", action.type);
  }
  next(action);
}

any help greatly appreciated!

Lin Du
  • 88,126
  • 95
  • 281
  • 483
  • https://redux.js.org/understanding/history-and-design/middleware#understanding-middleware doc explains clearly. – Lin Du May 10 '23 at 13:41

0 Answers0