18 lines
394 B
TypeScript
18 lines
394 B
TypeScript
// src/eventBus.ts
|
|
import mitt from "mitt";
|
|
|
|
// 定义事件名称和对应的数据类型
|
|
type Events = {
|
|
"my-event": { message2: string };
|
|
"otp-valid": { message2: string };
|
|
"app-valid": { message2: string };
|
|
"custom-otp-valid": { message2: string };
|
|
|
|
// 可以在这里添加其他事件
|
|
// 'another-event': number;
|
|
};
|
|
|
|
const eventBus = mitt<Events>();
|
|
|
|
export default eventBus;
|