RequestManager is a mixin that manages the lifecycle of a promise-backed request for a widget, such as the OO.ui.mixin.LookupElement.
- Source:
Methods
(abstract, protected) getRequest() → {jQuery.Promise}
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
(abstract, protected) getRequestCacheDataFromResponse(response) → {Mixed}
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 |
Mixed | Response from server |
- Source:
Returns:
Cached result data
- Type
- Mixed
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
(abstract, protected) getRequestQuery() → {string}
Get the query to be made.
- Source:
Returns:
query to be used
- Type
- string