/**
 * 充电桩大盘 - 状态管理模块
 */

export let state = {
  station: null,
  freeCache: {},
  chargingCache: {},
  occupiedCache: {},
  isWeekday: true,
  spinning: false,
  currentFilter: 'all',
  pollTimer: null,
  currentInterval: null,
  stationEtag: null,
  stationSignature: null,
};

export function resetState() {
  state = {
    station: null,
    freeCache: {},
    chargingCache: {},
    occupiedCache: {},
    isWeekday: true,
    spinning: false,
    currentFilter: 'all',
    pollTimer: null,
    currentInterval: null,
    stationEtag: null,
    stationSignature: null,
  };
}
