JSFiddle - React, Tailwind, and code Playground
JavaScript
const store = {
dima: 'friend',
igor: 'brother'
}
function loggerMiddlewear(store) {
return function (next) {
//console.log('Next value:',next)
return function (action) {
const result = next(action)
return result
}
}
}
loggerMiddlewear(store)((action)=>{console.log(action)})('ggg')