I wrote a middleware, like as blow :
const testMiddleware = ({ dispatch, getState }) => next => action => {
console.log('test middleware')
};
export default testMiddleware;
and added it to my store: applyMiddleware(testMiddleware)
in ever action, i get test middleware
in my console.
and i wrote a simple action, like this:
export const sayHi = () => {
return dispatch => {
console.log('hi');
}
}
How can i dispatch sayHi
action in my middleware?