填写这份《一分钟调查》,帮我们(开发组)做得更好!去填写Home

ServiceMessageBroker

Helper class for UIComponents that allows components to register methods. If a registered method message is received from the broker on the worker, the UIMessageBroker deserializes its arguments and calls the registered method. If that method returns a promise, the UIMessageBroker returns the result to the worker.

已弃用: platform-webworker is deprecated in Angular and will be removed in a future version of Angular

      
      interface ServiceMessageBroker {
  registerMethod(methodName: string, signature: (Type<any> | SerializerTypes)[], method: (..._: any[]) => void | Promise<any>, returnType?: Type<any> | SerializerTypes): void
}
    

方法

registerMethod(methodName: string, signature: (Type<any> | SerializerTypes)[], method: (..._: any[]) => void | Promise<any>, returnType?: Type<any> | SerializerTypes): void
      
      registerMethod(methodName: string, signature: (Type<any> | SerializerTypes)[], method: (..._: any[]) => void | Promise<any>, returnType?: Type<any> | SerializerTypes): void
    
参数
methodName string
signature (Type | SerializerTypes)[]
method (..._: any[]) => void | Promise
returnType Type | SerializerTypes

可选. 默认值是 undefined.

返回值

void