2 ms·
> By not understanding that you need to cleanup timers when your view unmounts I think this library eschews the entire concept of mounting so that point is kin
by Spivak 2y ago
> By not understanding that you need to cleanup timers when your view unmounts
I think this library eschews the entire concept of mounting so that point is kind of moot. Will you likely re-invent it again in any non-trivial app, sure, but when you're writing imperative JS it's probably a MPA where code runs top to bottom. Clean up will happen when everything gets thrown away on navigation.
- danielvaughn 2y agoYep, and if you are writing an SPA where cleanup is an issue, personally I think a web component would be a better fit. It's native to the platform and offers lifecycle hooks out of the box. I'm currently playing around with how my library might be used for web components.