Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
calebporzio committed Jun 27, 2024
1 parent 60d1ae8 commit e2c853c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
14 changes: 13 additions & 1 deletion packages/alpinejs/src/magics.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { getUtilities } from "./utils/get-utlilties";
import { getElementBoundUtilities } from "./directives";
import { interceptor } from "./interceptor";
import { onElRemoved } from "./mutation";

let magics = {}

Expand All @@ -20,3 +22,13 @@ export function injectMagics(obj, el) {

return obj
}

export function getUtilities(el) {
let [utilities, cleanup] = getElementBoundUtilities(el)

let utils = { interceptor, ...utilities }

onElRemoved(el, cleanup)

return utils;
}
13 changes: 0 additions & 13 deletions packages/alpinejs/src/utils/get-utlilties.js

This file was deleted.

0 comments on commit e2c853c

Please sign in to comment.