UNPKG

@gooddata/react-components

Version:

GoodData.UI - A powerful JavaScript library for building analytical applications

18 lines (17 loc) 712 B
/** * Clears whole cache * Needs to be called manually on-demand * * @method clearSdkCache */ export declare function clearSdkCache(): void; /** * Wraps some async call defined by onCacheMiss param and caches its result for next re-use. * If cached result is rejected it is removed from cache to unblock future calls * * @method getCachedOrLoad * @param {String} cacheKey - unique key to identify cached value * @param {Function} onCacheMiss - async function returning promise to call when value is not found in cache * @return {Promise} value from cache or result of onCacheMiss invocation */ export declare function getCachedOrLoad<T>(cacheKey: string, onCacheMiss: () => Promise<T>): Promise<T>;