import Response from '~/Contracts/ClientResponse'; import Guard from '~/Guards/Guard'; class MetaDeferGuard extends Guard { /** * * * @param {object} response * @return {boolean} */ public check(response: Response): boolean { // @ts-ignore return !response.data.metadata.defer; } /** * * * @return {Trending | null} */ public contingency() { const trending = this.storage.get(); console.info('TrendingService - Trending is currently in a deferred state.'); if (! trending) { console.warn('TrendingService - No previous trending data available in local-storage.'); } return trending; } /** * * * @return {boolean} */ public retry() { return false; } } export default MetaDeferGuard;