Zaelot-Inc / use-reducer-logger

A very basic logger for the useReducer function in the React Hooks API.
https://www.npmjs.com/package/use-reducer-logger
MIT License
94 stars 16 forks source link

Reducer executed multiple times #4

Closed andreschort closed 4 years ago

andreschort commented 5 years ago

Hi,

I noticed when I started using the logger my reducer was getting called more than once for each dispatched action. Looking at the logger function code I see it's calling the reducer twice.

Also, seems that if you use the logger function inside the React component function the reducer ends up being called even more times.

btw, cool library! Thanks!