W3cubDocs

/Angular 2

ServiceMessageBroker

Experimental Class

Class Overview

class ServiceMessageBroker {
  registerMethod(methodName: string, signature: Type<any>[], method: Function, returnType?: Type<any>) : void
}

Class Description

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.

Class Details

registerMethod(methodName: string, signature: Type<any>[], method: Function, returnType?: Type<any>) : void

exported from @angular/platform-webworker/index, defined in @angular/platform-webworker/src/web_workers/shared/service_message_broker.ts

© 2010–2017 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v2.angular.io/docs/ts/latest/api/platform-webworker/index/ServiceMessageBroker-class.html