Understanding Redux Middleware

Great tutorial, I spent two days on your tutorial, very helpful! Thanks! Now I totally understand middleware for redux. BTW, I think I found a bug in your code, in the function applyMiddleware:

export default function applyMiddleware(...middlewares) {

dispatch = compose(...chain, store.dispatch);

}. The expression for dispatch should be:

dispatch = compose(...chain)(store.dispatch), which I copied from redux source code. Check it out.