1//
2// | (• ◡•)| (❍ᴥ❍ʋ)
3//
4// The bit where we launch the Elm apps & workers,
5// and connect the other bits to it.
6
7import "./pointer-events"
8
9import * as Application from "./application"
10import * as Artwork from "./artwork"
11import * as Audio from "./audio"
12import * as Backdrop from "./backdrop"
13import * as Brain from "./brain"
14import * as Broadcast from "./broadcast"
15import * as Errors from "./errors"
16import * as Misc from "./misc"
17import * as ServiceWorker from "./service-worker"
18import * as Tracks from "./tracks"
19
20
21
22// 🌸
23
24
25const isNativeWrapper = !!globalThis.__TAURI__
26
27
28
29// 🚀
30
31
32ServiceWorker
33 .load({ isNativeWrapper })
34 .then(async (reg: ServiceWorkerRegistration) => {
35 const brain = await Brain.load()
36 const app = Application.load({ isNativeWrapper, reg })
37 const channel = Broadcast.channel()
38
39 // 🧑🏭
40 ServiceWorker.link({
41 app, isNativeWrapper, reg
42 })
43
44 // 🧠
45 Brain.link({
46 app, brain
47 })
48
49 // ⚡
50 Application.init(app, channel)
51 Artwork.init(app, brain)
52 Audio.init(app)
53 Backdrop.init(app)
54 Misc.init(app)
55 Tracks.init(app)
56 })
57 .catch(
58 Errors.failure
59 )