Redux middleware

Let me talk about the conclusion, what is the middleware Redux in
simple terms, is a function to accept the dispatch and dispatch function returns a function of
the role
of the original dispatch function enhancement, similar to the java proxy, the proxy method of enhanced
important feature
can be chained calls
a typical case

const logger = store => next => action {
	console.info("dispatching", action);
	let result = next(action);
	console.info("state", store.getState());
	return result;
}
Published 16 original articles · won praise 8 · views 8491

Guess you like

Origin blog.csdn.net/qq_34637782/article/details/86683013