Constructor
new OO.ui.mixin.RequestManager([config])abstract
#
RequestManager is a mixin that manages the lifecycle of a promise-backed request for a widget,
such as the OO.ui.mixin.LookupElement
.
Parameters:
Name | Type | Attributes | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
Object |
optional |
Configuration options Properties:
|
- Source:
RequestManager is a mixin that manages the lifecycle of a promise-backed request for a widget,
such as the OO.ui.mixin.LookupElement
.
Methods
getRequest() → {jQuery.Promise}abstractprotected
#
Get a new request object of the current query value.
- Source:
Returns:
jQuery AJAX object, or promise object with an .abort() method
- Type
- jQuery.Promise
getRequestCacheDataFromResponse(response) → {any}abstractprotected
#
Pre-process data returned by the request from #getRequest.
The return value of this function will be cached, and any further queries for the given value will use the cache rather than doing API requests.
Parameters:
Name | Type | Description |
---|---|---|
response |
any | Response from server |
- Source:
Returns:
Cached result data
- Type
- any
getRequestData() → {jQuery.Promise}
#
Get request results for the current query.
- Source:
Returns:
Promise object which will be passed response data as the first argument of the done event. If the request was aborted to make way for a subsequent request, this promise may not be rejected, depending on what jQuery feels like doing.
- Type
- jQuery.Promise
getRequestQuery() → {string}abstractprotected
#
Get the query to be made.
- Source:
Returns:
query to be used
- Type
- string