onReceiveDone
onReceiveDone
Called when the request cycle finishes, whether it succeeded or failed.
Parameters
provInstName(string): The name of the Provider Instance that sent the requestisSuccess(bool): Whether it succeeded
Returns: No return value — this is a callback, so its return value isn't used.
Description
Suited to work that only needs to know the request is over, regardless of success or failure — turning off a loading indicator, for instance.
Example
function onReceiveDone(provInstName, isSuccess) {
$vm.setDSValue("uiState.loading", false);
if (!isSuccess) {
$log.i(provInstName + " failed");
}
}
Related
- When you need the failure reason (code or message), use
onReceiveErrorinstead.onReceiveDoneonly tells you whether it succeeded. - Don't confuse it with
onRequestAfter, which fires right after the request and before the response —onReceiveDonefires once the response is complete. - There is no
onReceiveDoneequivalent for subscription (Push) data updates. The Push path ends atonPushUpdateAfter; this event belongs to the normal request (requestData) cycle only.