import { PageListController } from "@queenjs/controllers";
import { ModuleRoot } from "queenjs";
import actions from "./actions";
import { https } from "./http";
import { stores } from "./stores";
import { NatsController } from "@/comm/controllers/natsCtrl";

export default class ListModule extends ModuleRoot {
  config = this.setConfig({
    httpConfig: {
      baseURL: "./",
    },
  });
  store = this.createStore([stores]);
  actions = this.createActions(actions);
  https = this.createHttps([https]);
  controls = {
    // bus: new NatsController(),
    backendList: new PageListController(this.config.httpConfig),
  };

  onReady() {
    this.actions.getProfileData();
    this.actions.initAnimateAttr();
  }
}
export const { useList, initList, setList } = ListModule.hook("List");
