How can I read the following arrow function in English? I can understand that there are 2 parameters namely dispatch and getState. How do I read the remaining part?
How to write it as a normal function?
const apiMiddleware = ({ dispatch, getState}) => next => action => {
Written as a normal function, the declaration will look like this:
const apiMiddleware = function({ dispatch, getState}){
return function(next) {
return function(action) {
return something;
}
}
}
I suggest you to read this great article about higher order arrow functions here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With