Class: LifecycleRemoteRequestUtils

LifecycleRemoteRequestUtils(lifecycleObject)

new LifecycleRemoteRequestUtils(lifecycleObject)

Parameters:
Name Type Description
lifecycleObject FragmentLifeCycleInstance
Source:

Extends

Members

activeRequests :Array.<ActiveRemoteRequests>

Type:
  • Array.<ActiveRemoteRequests>
Overrides:
Source:

lifecycleObject :FragmentLifeCycleInstance

Type:
  • FragmentLifeCycleInstance
Source:

Methods

abortRequest(id)

Consoles an error if failed to abort request
Parameters:
Name Type Description
id string
Overrides:
Source:

abortRunningRequests()

Use internally and carefully
Overrides:
Source:

canProcessRequest(status) → {boolean}

Override in children Called when the request has been completed Override and check whether request processing can proceed based on response This involves checking the status and determining whether the request has been approved by the API Returning true allows the
Parameters:
Name Type Description
status number
Overrides:
Source:
Returns:
Whether the request is completed as per API requirements
Type
boolean

isFragmentRunning()

Returns true based on lifecycle stage
Overrides:
Source:

makeRemoteRequest(requestOptions, successCallback, errorCallback, customXHReqopt, overrideStateCbopt, overrideIDopt) → {string}

Run in a try catch. Throws error if fragment dead and making request
Parameters:
Name Type Attributes Description
requestOptions RequestOptions
successCallback remoteReqSuccessCb.<{}>
errorCallback remoteReqErrCb
customXHReq XMLHttpRequest <optional>
Will be deprecated
overrideStateCb overrideStateCb <optional>
Might be deprecated if lifecycle non-enforceable with it. Trying some code to see
overrideID string <optional>
Overrides:
Source:
Returns:
The ID of the request
Type
string