Saving of nodes

This commit is contained in:
Magnus Åhall 2025-07-03 13:25:08 +02:00
parent c5bec0afa6
commit 08fd2cf4e9
16 changed files with 852 additions and 42 deletions

17
static/js/mbus.mjs Normal file
View file

@ -0,0 +1,17 @@
export class MessageBus {
constructor() {
this.bus = new EventTarget()
}
subscribe(eventName, fn) {
this.bus.addEventListener(eventName, fn)
}
unsubscribe(eventName, fn) {
this.bus.removeEventListener(eventName, fn)
}
dispatch(eventName, data) {
this.bus.dispatchEvent(new CustomEvent(eventName, { detail: data }))
}
}