1
0
Fork 0
mirror of https://github.com/archtechx/alpine-typescript.git synced 2025-12-12 06:44:03 +00:00

Automatically register the bootstrapper

This commit is contained in:
Samuel Štancl 2021-02-26 16:41:31 +01:00
parent f7db3d093c
commit e7c97d9cc5
2 changed files with 6 additions and 2 deletions

View file

@ -62,7 +62,7 @@ export function convertClassToAlpineConstructor(component: any): ComponentConstr
}
}
export default () => {
export function bootstrap(): void {
window.AlpineComponents = {};
const deferrer = window.deferLoadingAlpine || function (callback: CallableFunction) { callback() };
@ -73,3 +73,7 @@ export default () => {
deferrer(callback);
}
}
if (window.AlpineComponents === undefined) {
bootstrap();
}