[deploy] Emit frontend bundle as ESM for browser
All checks were successful
Deploy Discord Bot / deploy (push) Successful in 38s

This commit is contained in:
Pascal Prießnitz
2025-12-04 17:06:27 +01:00
parent 18a47c0426
commit 7a296f7b4a
28 changed files with 185 additions and 273 deletions

View File

@@ -1,14 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.initConfig = initConfig;
exports.getConfig = getConfig;
exports.getState = getState;
exports.setState = setState;
exports.subscribe = subscribe;
let config = null;
let state = {};
const listeners = new Set();
function initConfig(next) {
export function initConfig(next) {
config = next;
state = {
guildId: next.initialGuildId,
@@ -16,17 +9,17 @@ function initConfig(next) {
userLabel: next.userLabel
};
}
function getConfig() {
export function getConfig() {
return config;
}
function getState() {
export function getState() {
return state;
}
function setState(partial) {
export function setState(partial) {
state = { ...state, ...partial };
listeners.forEach((l) => l(state));
}
function subscribe(listener) {
export function subscribe(listener) {
listeners.add(listener);
return () => listeners.delete(listener);
}