v0.20.230 - 6.1 / 5.8

use:disconnected

Element attribute that runs its callback just before the element is removed from the document. Useful for tearing down non-reactive subscriptions tied to the live DOM — for reactive-scope teardown, prefer cleanup. Accepts a single callback or an array of callbacks.

# Arguments

nametypedescription
fnfnfunction to run just before the Element is removed from the document

# Snippet

# Test

Show when the elements are about to be removed from the document