-
-
Notifications
You must be signed in to change notification settings - Fork 90
fix for useDisposable, update some dev deps #46
Conversation
Btw, I switched useUnmount to useLayoutEffect since it fixed an issue with useDisposable and basically it is being used internally to dispose a reaction (so the disposal doesn't get delayed), just to be on the safe side. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some small nit-picks, good work otherwise for sure! Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last small thing. Also, coverage has dropped by 2% because of that production check. Nothing too horrible, but should be fairly easy to fix. Just set a NODE_ENV for the test and revert it after.
done, checks for prod mode and console error an actual error object |
Thank you very much for the work. |
According to an update of the react hooks faq:
https://reactjs.org/docs/hooks-faq.html#how-to-memoize-calculations
This PR uses the recommended approach of lazy initialization, plus makes sure the effect is not re-created when some inputs are given and the effect is manually early disposed
Also updates some dev deps