2020-11-13 16:42:32 +01:00
|
|
|
import ClientApp from "./components/ClientApp.svelte"
|
2019-09-07 07:50:35 +02:00
|
|
|
|
2020-11-23 15:28:02 +01:00
|
|
|
let app
|
|
|
|
|
2020-11-13 16:42:32 +01:00
|
|
|
const loadBudibase = () => {
|
2020-11-23 15:28:02 +01:00
|
|
|
// Destroy old app if one exists
|
|
|
|
if (app) {
|
|
|
|
app.$destroy()
|
|
|
|
}
|
|
|
|
// Create new app
|
|
|
|
app = new ClientApp({
|
2020-11-13 16:42:32 +01:00
|
|
|
target: window.document.body,
|
2020-05-29 15:06:10 +02:00
|
|
|
})
|
2020-02-03 10:24:25 +01:00
|
|
|
}
|
|
|
|
|
2020-11-13 16:42:32 +01:00
|
|
|
// Attach to window so the HTML template can call this when it loads
|
|
|
|
window.loadBudibase = loadBudibase
|