-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
enhancementNew feature or requestNew feature or request
Description
this.createEffect() will make an effect that is conveniently stopped in disconnectedCallback. This is useful for creating effects in connectedCallback and then not having to use createRoot and disconnectedCallback to stop them.
Currently:
connectedCallback() {
super.connectedCallback()
createRoot(dispose => {
this.dispose = dispose
createEffect(() => {
// ...
onCleanup(() => {...})
})
})
}
disconnectedCallback() {
super.disconnectedCallback()
this.dispose()
}Using this.createEffect:
connectedCallback() {
super.connectedCallback()
this.createEffect(() => {
// ...
onCleanup(() => {...})
})
}Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request