收藏
回答

Skyline 模式下 mobx-miniprogram-bindings 只能手工绑定吗?

Skyline 模式下 mobx-miniprogram-bindings 只能手工绑定吗?BehaviorWithStore绑定报错

import { createStoreBindings } from "mobx-miniprogram-bindings";
import { store as receiveds } from "./reservations";

const STORE_TYPES = {
   RECEIVED_RESERVATIONS: "ReceivedReservations",
};

const STORE_CONFIGS = {
   [STORE_TYPES.RECEIVED_RESERVATIONS]: {
      store: receiveds,
      fields: ["receiveds"],
      actions: ["updatedReceived"],
   },
};

export const handleStores = (context, stores) => {
   return stores.map((store) => {
      const config = STORE_CONFIGS[store];
      if (!config) {
         throw new Error(`Unknown store type: ${store}`);
      }
      return createStoreBindings(context, config);
   });
};

回答关注问题邀请回答
收藏

1 个回答

  • hello world
    hello world
    14小时前

    需要问一下第三方了

    14小时前
    有用
    回复
登录 后发表内容