Methods
addProvider(provider)
#
Add a provider to the group.
Parameters:
Name | Type | Description |
---|---|---|
provider |
mw.widgets.APIResultsProvider | A provider object |
get([howMany]) → {jQuery.Promise}
#
Get items from the queue.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
howMany |
number |
optional |
How many items to retrieve. Defaults to the default limit supplied on initialization. |
Returns:
Promise that resolves into an array of items.
- Type
- jQuery.Promise
getLang() → {string|undefined
}
#
undefined
}
#
getParams() → {Object}
#
getProviders() → {Array.<mw.widgets.APIResultsProvider>}
#
Set the providers.
Returns:
providers An array of providers
getThreshold() → {number}
#
Get queue threshold.
Returns:
threshold Queue threshold, below which we will request more items
- Type
- number
queryProviders([howMany]) → {jQuery.Promise}
#
Get results from all providers.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
howMany |
number |
optional |
How many items to retrieve. Defaults to the default limit supplied on initialization. |
Returns:
Promise that is resolved into an array of fetched items. Note: The promise must have an .abort() functionality.
- Type
- jQuery.Promise
reset()
#
Reset the queue and all its providers.
setLang(lang)
#
Set language for the query results.
Parameters:
Name | Type | Description |
---|---|---|
lang |
string
|
undefined
|
Language |
setParams(params)
#
Set the search query for all the providers.
This also makes sure to abort any previous promises.
Parameters:
Name | Type | Description |
---|---|---|
params |
Object | API search parameters |
setProviders(providers)
#
Set the providers.
Parameters:
Name | Type | Description |
---|---|---|
providers |
Array.<mw.widgets.APIResultsProvider> | An array of providers |
setThreshold(threshold)
#
Set queue threshold.
Parameters:
Name | Type | Description |
---|---|---|
threshold |
number | Queue threshold, below which we will request more items |
setup() → {jQuery.Promise}
#
Set up the queue and its resources. This should be overridden if there are any setup steps to perform.
Returns:
Promise that resolves when the resources are set up. Note: The promise must have an .abort() functionality.
- Type
- jQuery.Promise