Commit b5426e69 authored by timel's avatar timel

feat: add comment

parent 190e558d
...@@ -10,6 +10,7 @@ export enum Task { ...@@ -10,6 +10,7 @@ export enum Task {
const getEnd = (task: Task) => `${task}-end`; const getEnd = (task: Task) => `${task}-end`;
/** 在组件之中注册方法 */
const register = (task: Task, fn: (...args: any[]) => Promise<any>) => { const register = (task: Task, fn: (...args: any[]) => Promise<any>) => {
eventEmitter.on( eventEmitter.on(
task, task,
...@@ -20,6 +21,7 @@ const register = (task: Task, fn: (...args: any[]) => Promise<any>) => { ...@@ -20,6 +21,7 @@ const register = (task: Task, fn: (...args: any[]) => Promise<any>) => {
); );
}; };
/** 在service之中调用组件中的方法 */
const call = (task: Task, ...args: any[]) => const call = (task: Task, ...args: any[]) =>
new Promise<void>((rs) => { new Promise<void>((rs) => {
const taskId = v4uuid(); const taskId = v4uuid();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment