poll

Function

Function to poll a provided request until a validation state or timeout is reached

NOTE: we expose this as a public util, but should use this functionality sparingly when dealing with the Portal API. Best practice is to leverage this polling functionality internally on functions that we know incur a Portal delay.

Function to poll a provided request until a validation state or timeout is reached

NOTE: we expose this as a public util, but should use this functionality sparingly when dealing with the Portal API. Best practice is to leverage this polling functionality internally on functions that we know incur a Portal delay.

  • poll(requestFn: function() : any, validationFn: function(resp: any) : boolean, opts: {
    timeBetweenRequests:
    number
    timeout:
    number
    }) : Promise<any>

Parameters

Parameter Type Default Notes
requestFn Required function() : any
validationFn Required function(resp: any) : boolean
opts Optional {
timeBetweenRequests:
number
timeout:
number
}

Returns

Promise<any>

Function defined in common/src/utils/poll.ts:14