[deploy] Emit frontend bundle as ESM for browser
All checks were successful
Deploy Discord Bot / deploy (push) Successful in 38s
All checks were successful
Deploy Discord Bot / deploy (push) Successful in 38s
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user