hooks.macro icon indicating copy to clipboard operation
hooks.macro copied to clipboard

Feature request: debugChangedDependencies

Open adrianhelvik opened this issue 5 years ago • 2 comments

I've been using hooks.macro daily for quite some time now and love it. There is however one pain point I'm struggling a bit with. When effects get hairy it can be difficult to pinpoint what caused the effect to be re-evaluated.

This would be a good solution for this problem. What do you think?

import { logChangedDependencies } from 'hooks.macro'

useAutoEffect(() => {
  logChangedDependencies()
  // way too much code...
})

could log out this message:

[hooks.macro] Changed dependencies: someVar, someOtherVar

adrianhelvik avatar Sep 04 '20 10:09 adrianhelvik

I can try to make another pull request next week if you'd like. My macro chops have improved since last time. 🙂 Do you have any inputs on the API or functionality?

adrianhelvik avatar Sep 11 '20 16:09 adrianhelvik

This is a duplicate of #2 by the way 🙂

tom-sherman avatar Oct 17 '20 10:10 tom-sherman