Constructor
new FetchQL(options)
Create a FetchQL instance.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
Extends
Methods
addInterceptors(interceptors)
add new interceptors
Parameters:
Name | Type | Description |
---|---|---|
interceptors |
Object | Array.<Object> |
- Overrides:
- Source:
clearInterceptors()
remove all interceptors
- Overrides:
- Source:
getEnumTypes(EnumNameList) → {Promise}
get information of enum type
Parameters:
Name | Type | Description |
---|---|---|
EnumNameList |
Array.<String> | array of enums' name |
Returns:
- Type
- Promise
getUrl() → {String}
get current server address
Returns:
- Type
- String
onEnd()
calling on a request ending
if current queue finished, calling the 'onEnd' method
onStart()
calling on a request starting
if the request belong to a new queue, call the 'onStart' method
query(options) → {Promise}
operate a query
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
Returns:
- Type
- Promise
removeInterceptors(indexes)
remove interceptors by indexes
Parameters:
Name | Type | Description |
---|---|---|
indexes |
Array.<number> |
- Overrides:
- Source:
setUrl(url)
setting a new server address
Parameters:
Name | Type | Description |
---|---|---|
url |
String |
Type Definitions
requestQueueChanged(queueLength)
Callback of requests queue changes.(e.g. new queue or queue finished)
Parameters:
Name | Type | Description |
---|---|---|
queueLength |
number | length of current request queue |