simbathesailor/use-effect-x

Maybe could be better use customhook

Opened this issue · 0 comments

hi simbathesailor.

I really appreciate what you did and the idea you got.

However, in my opinion, could be better use just two other customHook that provide a check of firstrun and previus object by dependency.

In term of separation concerns, maybe this my replacement avoid an array of dependency in favor of a single watch property (maybe useful in redux).

This is the gist after you have imported the BetterUseEffect function you can use it instead of plain useEffect.

Tell me if you like my idea.