Docs (4.0.0)
class Activity method

observeService

Observes a particular service by ID, until the activity is unlinked.

protected

protected observeService<TService extends Service>(id: string, observer?: Observer<TService> | ManagedObject.AttachObserverFunction<TService>): Observer<TService>

Parameters

  • id — The ID of the service to be observed
  • observer — An Observer class or instance, or a function that’s called whenever a change event is emitted by the service (with service and event arguments, respectively), and when the current service is unlinked (without any arguments)

Return value

The observer instance, which references the observed service using the observed property

Related

  • class ActivityA class that represents a part of the application that can be activated when the user navigates to it.