This commit is contained in:
2024-04-29 20:56:37 -07:00
parent 8afbc124c4
commit 1b80712742
7 changed files with 28 additions and 15 deletions

View File

@@ -35,4 +35,11 @@ Alpine.directive('hx-header', (el, { value, expression }, { evaluateLater, effec
})
})
})
Alpine.directive(
"destroy",
(el, { expression }, { evaluateLater, cleanup }) => {
const onDestroy = evaluateLater(expression);
cleanup(onDestroy);
}
);
})