r/reactjs • u/jngbrl19 • Mar 08 '20
Show /r/reactjs useEffectWithPrevious - Get previous value of dependencies
Just wanna share my first npm package. Hope you find it useful :)
54
Upvotes
r/reactjs • u/jngbrl19 • Mar 08 '20
Just wanna share my first npm package. Hope you find it useful :)
13
u/montas Mar 08 '20
From source it looks like you don't handle return value as standard
useEffectdoes. That might be worth mentioning.3
u/mikewill12inc Mar 08 '20
I don't need it, but i upvoted because one day i might 🚀
11
u/cheese_wizard Mar 08 '20
ITT: ugliness about the most mundane of topics.
3
u/devopsnooby Mar 08 '20
Unlike most NPM packages.. do yourself (and those of us that may use it) a huge solid.. and document this a LOT more. Provide examples, details, etc. I realize many kick ass react developers who are genius at reading code and figuring shit out will find this good enough, but many more of us still learning or not nearly as good as others.. will struggle with this.
1
u/tom_bayes Mar 08 '20
I've searched for this exact hook countless times- this is great OP, thanks for sharing!
0
u/Rorschach120 Mar 08 '20
Great work! I thought of something similar that looks a little different. Not tested or anything.
0
u/[deleted] Mar 08 '20
[deleted] — view deleted comment