IService.subscribe() method
Subscribe to changes in the service
Signature
subscribe(fn: () => void): number;
Parameters
| Parameter | Type | Description |
|---|---|---|
| fn | () => void | Callback function to be invoked when there is a change in the service |
Returns
| Type | Description |
|---|---|
| number | An ID to be used to unsubscribe |
Throws
| Error |
|---|