Methods
publish
- publish(topic: string, info: any): void
subscribe
- subscribe(topic: string, listener: func): { remove: () => void }
-
Parameters
-
topic: string
-
listener: func
Returns { remove: () => void }
Static getInstance
- getInstance(forceRecreate?: boolean): Observer
-
Parameters
-
Default value forceRecreate: boolean = false
Implement a simple pub/sub pattern to have components communication without attributes. This class is Singleton, use getInstance to get the global obj.