General statistics
List of Youtube channels
Youtube commenter search
Distinguished comments
About
Theo - t3․gg
comments
Comments by "" (@diadetediotedio6918) on "I might have a new favorite state manager..." video.
Would not it be clearer in react if you just made an utility, like: function effect({ deps, run, cleanup }: { deps: any[], run: () -> void, cleanup: () -> void }) { useEffect(() => { run(); return cleanup; }, deps); } that you can then use like this: effect({ deps: [slug], run: () => { ... }, cleanup: () => { ... } }) I feel like at least some of the problems with useEffect is that it is too much quirky to use, so wrapping it maybe provide some benefits.
2
@requindr My whole point is that it does provide benefits (semantic ones), lol. And if someone gets confused by this I don't think this person is a programmer, those are literally plain english words with well defined meanings in react, I'm not presenting a theorem proof in modal logic.
1