Request class
Used to make AJAX requests and also cache the response in IndexedDB.
It can also return the cached response if the request fails or times out (see StorageMode).
Adds a cancellation token to the request (used to cancel the request)
cancellationToken: The cancellation token
Note: The request will finish executing, but the success/error callbacks will not be called if the request is cancelled.
Sets the parser for the request
parser: The parser
Parameters
parser: (response:Response)=>Promise<any>
Returns this
withRetryAttempts
withRetryAttempts(retryAttempts:number):this
Sets the number of retry attempts for the request
retryAttempts: The number of retry attempts (default: 3)
Note: The retry attempts are only used for network requests
Parameters
retryAttempts: number
Returns this
withRetryDelay
withRetryDelay(retryDelay:number):this
Sets the retry delay for the request in milliseconds
retryDelay: The retry delay in milliseconds (default: 1000)
Note: The retry delay is only used for network requests
Request class Used to make AJAX requests and also cache the response in IndexedDB. It can also return the cached response if the request fails or times out (see StorageMode).