0

I was reading about redux middle ware and I noticed a below function. As you see, it has three "=>". Can someone please explain how does these three "=>" work?

const logger = store => next => action => {
  console.log('dispatching', action)
  let result = next(action)
  console.log('next state', store.getState())
  return result
}

Can we pass these parameters in parenthesis as below instead?

const logger = (store, next, action) => {
 ... ... ...
 ... ... ...
}
Shwe
  • 455
  • 5
  • 11
  • `logger` is a function which returns a function which returns a function which returns a function. – deceze Mar 05 '20 at 15:23
  • *"Can we pass these parameters in parenthesis as below instead?"* -- No, those are not synonymous lines of code. – George Mar 05 '20 at 15:26

0 Answers0