UNPKG

@sepveneto/mpd-core

Version:

## 安装 ```cmd pnpm i @sepveneto/mpd-core npm i @sepveneto/mpd-core yarn add @sepveneto/mpd-core ```

32 lines (29 loc) 829 B
import { Emitter } from "./chunk-GPC2YLSI.js"; // src/helper.ts import microApp from "@micro-zoe/micro-app"; function initEmitter(config) { const baseEvent = new Emitter(); const appEvent = new Emitter(); baseEvent.on("SET_CONFIG", (val) => { var _a; (_a = config == null ? void 0 : config.SET_CONFIG) == null ? void 0 : _a.call(config, val); }); baseEvent.on("SET_DELETE", (val) => { var _a; (_a = config == null ? void 0 : config.SET_DELETE) == null ? void 0 : _a.call(config, val); }); baseEvent.on("SET_SELECTED", (val) => { var _a; (_a = config == null ? void 0 : config.SET_SELECTED) == null ? void 0 : _a.call(config, val); }); microApp.setGlobalData({ BASE_EMITTER: baseEvent, MPD_EMITTER: appEvent }); return { baseEvent, appEvent }; } export { initEmitter };