Expand all

abstract OO.ui.mixin.RequestManager

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:
Name Type Attributes Default Description
showPendingRequest boolean optional
true

Show pending state while request data is being fetched. Requires widget to have also mixed in OO.ui.mixin.PendingElement.

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
Get a new request object of the current query value.

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
Pre-process data returned by the request from #getRequest.

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
Get request results for the current query.

getRequestQuery() → {string}abstractprotected #

Get the query to be made.

Source:

Returns:

query to be used

Type
string
Get the query to be made.