Created
April 8, 2025 14:50
-
-
Save mrgenixus/e01b3f707b16c474f336aec7db1dc7cb to your computer and use it in GitHub Desktop.
Redux Logger Middleware (simple)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const loggerMiddleware = (logger) => (store) => (next) => async (action) => { | |
const response = await next(action); | |
logger(action.type, store.getState()); | |
return response; | |
} | |
export default loggerMiddleware(console.log); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment