Extends
Properties
getRequestPromise
#
Get an API request promise to deal with a list of titles
Methods
get(title) → {jQuery.Promise}
#
Look up data about a title. If the data about this title is already in the cache, this returns an already-resolved promise. Otherwise, it returns a pending promise and schedules an request to retrieve the data.
Parameters:
| Name | Type | Description |
|---|---|---|
title |
string |
Returns:
Promise that will be resolved with the data once it's available
- Type
- jQuery.Promise
- Inherited from:
- Source:
getCached(name) → {Object|undefined}
#
undefined}
#
Look up data about a page in the cache. If the data about this page is already in the cache, this returns that data. Otherwise, it returns undefined.
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | Normalized page title |
Returns:
Cache data for this name.
- Type
-
Object
|
undefined
init()
#
Initialize the caches.
Can be called again to reset the cache, e.g. by tests
- Inherited from:
- Source:
processQueue()private
#
Perform any scheduled API requests.
Fires:
set(entries)
#
Add entries to the cache. Does not overwrite already-set entries.
Parameters:
| Name | Type | Description |
|---|---|---|
entries |
Object | Object keyed by page title, with the values being data objects |
Fires:
- Inherited from:
- Source: