How dispatch works in Reducer pattern
1 min readJun 11, 2020
Well, it uses two parentheses of functions, one anonymous function.
// addBlogPost
function foo(bar) {
return (a, b) => {
bar(a, b);
}
}
// dispatch
function bar(a, b) {
console.log(a, b);
}
foo(bar)(1, 2);