Skip to content

Commit

Permalink
Ensure x-merge works outside of an Alpine component
Browse files Browse the repository at this point in the history
Fixes #45
  • Loading branch information
imacrayon committed Jan 3, 2024
1 parent 11695ca commit f0d0bbb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"HTML",
"AlpineJS"
],
"version": "0.4.0",
"version": "0.4.1",
"license": "MIT",
"author": "Christian Taylor",
"homepage": "https://alpine-ajax.js.org",
Expand Down
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ function Ajax(Alpine) {
}
})

Alpine.addInitSelector(() => `[${Alpine.prefixed('merge')}]`)

Alpine.directive('merge', (el, { modifiers, expression }) => {
mergeConfig.set(el, {
strategy: expression,
Expand Down

0 comments on commit f0d0bbb

Please sign in to comment.