The callback object is used for all service calls and has an onSuccess and onFailure function. Any object with an
onSuccess and onFailure function can used in place of this Callback example object.
The onSuccess function is called with the response from the service when the call completes normally without any error. The onFailure function is called with an error message if the call fails.
The onSuccess function is called with the response from the service when the call completes normally without any error. The onFailure function is called with an error message if the call fails.
Methods
onFailure(message)
Called with an error message if the call fails.
Parameters:
Name | Type | Description |
---|---|---|
message |
string | The error message returned from the service. |
onSuccess(result)
Called with the response from the service when the call completes normally without any error.
Parameters:
Name | Type | Description |
---|---|---|
result |
Object | The response type as indicated by the service response documentation. |