mirror of
https://github.com/archtechx/airwire.git
synced 2025-12-12 02:34:04 +00:00
19 lines
576 B
TypeScript
19 lines
576 B
TypeScript
let state = window as any;
|
|
|
|
export default () => {
|
|
const deferrer = state.deferLoadingAlpine || function (callback: CallableFunction) { callback() }
|
|
|
|
state.deferLoadingAlpine = function (callback: CallableFunction) {
|
|
state.Alpine.addMagicProperty('$airwire', (el: any) => {
|
|
return function (...args: any) {
|
|
if (args) {
|
|
return window.Airwire.component(args[0], args[1], el.__x.$data.$reactive)
|
|
}
|
|
|
|
return window.Airwire;
|
|
}
|
|
})
|
|
|
|
deferrer(callback)
|
|
}
|
|
}
|