getData
Get raw data from the cache if available, and then update the instance later with data from the base connection.
connection.getData(params)
Checks the cacheConnection for params
's data.
If the cache connection has data, the cached data is returned. Prior to returning the data, the hydrateInstance method is intercepted so we can get a handle on the instance that's being created for the returned data. Once the intercepted instance is retrieved, we use the base connection to get data and update the intercepted instance and the cacheConnection.
If the cache connection does not have data, the base connection is used to load the data and the cached connection is updated with that data.
Parameters
- params
{Object}
:The set to load.
Returns
{Promise<Object>}
:
A promise that returns the raw data.