Skip to content

Commit

Permalink
More plugin Shapes (#3497)
Browse files Browse the repository at this point in the history
* ✨ Allows more Plugin shapes

* ♻️ Refactors for speed

and power

* Restrict plugin syntax to only single callback or array of callbacks

---------

Co-authored-by: Caleb Porzio <calebporzio@gmail.com>
  • Loading branch information
ekwoka and calebporzio committed May 11, 2023
1 parent 117668f commit 7201ff1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/alpinejs/src/plugin.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import Alpine from './alpine'
import Alpine from "./alpine";

export function plugin(callback) {
callback(Alpine)
let callbacks = Array.isArray(callback) ? callback : [callback]

callbacks.forEach(i => i(Alpine))
}

0 comments on commit 7201ff1

Please sign in to comment.