Home / @sym20/core-ui / IService / subscribe

IService.subscribe() method

Subscribe to changes in the service

Signature
subscribe(fn: () => void): number;

Parameters

ParameterTypeDescription
fn() => void

Callback function to be invoked when there is a change in the service

Returns

TypeDescription
number

An ID to be used to unsubscribe

Throws

Error