Skip to main content

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 request
  • isSuccess (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 onReceiveError instead. onReceiveDone only tells you whether it succeeded.
  • Don't confuse it with onRequestAfter, which fires right after the request and before the response — onReceiveDone fires once the response is complete.
  • There is no onReceiveDone equivalent for subscription (Push) data updates. The Push path ends at onPushUpdateAfter; this event belongs to the normal request (requestData) cycle only.