GenericExternalService
A generic external service providing external resources.
GenericExternalService
provides an implementation of ExternalService
for external resources by lifting the open
and close
operations from ExternalResource
to the subscribe
and unsubscribe
operations required by ExternalService
.
Implements
ExternalService
Constructors
new GenericExternalService()
new GenericExternalService(resources): GenericExternalService
Parameters
Parameter | Type | Description |
---|---|---|
resources | {} | Association of resource names to ExternalResource s. |
Returns
Methods
shutdown()
shutdown(): void
Shutdown the external service.
Returns
void
Implementation of
ExternalService.shutdown
subscribe()
subscribe(
resourceName,
params,
callbacks): void
Subscribe to a resource provided by the external service.
Parameters
Parameter | Type | Description |
---|---|---|
resourceName | string | - |
params | Json | Parameters of the external resource. |
callbacks | { error : (error ) => void ; loading : () => void ; update : (updates , isInit ) => void ; } | Callbacks to react on error/loading/update. |
callbacks.error | (error ) => void | Error callback. |
callbacks.loading | () => void | Loading callback. |
callbacks.update | (updates , isInit ) => void | Update callback. |
Returns
void
Implementation of
ExternalService.subscribe
unsubscribe()
unsubscribe(resourceName, params): void
Unsubscribe from a resource provided by the external service.
Parameters
Parameter | Type | Description |
---|---|---|
resourceName | string | - |
params | Json | Parameters of the external resource. |
Returns
void
Implementation of
ExternalService.unsubscribe