matthewp / haunted

React's Hooks API implemented for web components 👻
BSD 2-Clause "Simplified" License
2.6k stars 92 forks source link

Notify RootPart of disconnect when disconnecting component #407

Open megheaiulian opened 2 years ago

megheaiulian commented 2 years ago

When a component rendered with lit-html is disconnected we should notify the template's RootPart of the disconnect so that its async directives get disconnected too. On disconnect we could call removePart (https://github.com/lit/lit/blob/main/packages/lit-html/src/directive-helpers.ts#L216).