Web component gotcha: constructor vs connectedCallback

from blog Read the Tea Leaves, | ↗ original
A common mistake I see in web components is this: This setupLogic() can be just about anything – subscribing to a store, setting up event listeners, etc. The teardownLogic() is designed to undo those things – unsubscribe from a store, remove event listeners, etc. The problem is that constructor is called once, when the component […]