feat: 完善client相关功能 重构server部分

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2021-08-14 12:43:20 +08:00
parent 774763be13
commit 53502e12cf
34 changed files with 2893 additions and 20 deletions

View File

@@ -0,0 +1,14 @@
// import type * as Emitter from "component-emitter";
import { EventEmitter } from "events"
import { StrictEventEmitter } from "./typed-events"
export function on(
obj: EventEmitter | StrictEventEmitter<any, any>,
ev: string,
fn: (err?: any) => any
): VoidFunction {
obj.on(ev, fn)
return function subDestroy(): void {
obj.off(ev, fn)
}
}