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

export default class ListModule extends ModuleRoot {
  config = this.setConfig({
    httpConfig: {
      baseURL: "https://www.infish.cn/sku3d/v1/website",
    },
  });
  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.initAnimateAttr();
  }
}
export const { useList, initList, setList } = ListModule.hook("List");
