import { emitEvent } from "./events.js";

export const STATE = {
  initialization: 0,
  planning: 1,
};

export let state = STATE.initialization;

export function setState(newState) {
  state = newState;
  emitEvent("state");
}

export function getState() {
  return Object.entries(STATE).find(([,v]) => v === state)[0];
}