Every line of 'reset cache react native' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
15 componentDidMount() { 16 this.cacheSub = this.props.client 17 .subscribe({ 18 query: CACHE_INVALID_SUB, 19 variables: { 20 client: this.props.clientId, 21 }, 22 }) 23 .subscribe({ 24 next: ({loading}) => { 25 if (!loading) { 26 // Reset all of the sounds that are currently playing 27 this.props.removeAllSounds(); 28 if ( 29 excludedStations.indexOf(this.props.station.name) > -1 || 30 (this.props.station.cards && 31 this.props.station.cards.find( 32 c => excludedStations.indexOf(c.component) > -1, 33 )) 34 ) 35 return; 36 this.props.playSound({url: "/sciences.ogg"}); 37 this.props.reset && this.props.reset(); 38 publish("widgetClose"); 39 } 40 }, 41 error(err) { 42 console.error("Error resetting cache", err); 43 }, 44 }); 45 }
22 reset() { 23 this.commandLogs = []; 24 this.root = new NativeElement('root', 1, {}); 25 this.nativeElementMap = new Map(); 26 this._lastTagUsed = 1; 27 this.nativeElementMap.set(1, this.root); 28 this._platform = 'android'; 29 }
72 public reset(): Promise { 73 this.data = {}; 74 this.broadcastWatches(); 75 76 return Promise.resolve(); 77 }
97 reset() { 98 this.store = new Map(); 99 }
55 reset() { 56 this.minIndex = +Infinity; 57 this.maxIndex = -Infinity; 58 this.items.clear(); 59 this.averageSizeFloat = this.itemSize; 60 this.averageSize = this.itemSize; 61 this.recalculateAverage.reset(); 62 }
234 cacheReset() { 235 return this.lruCache.reset(); 236 }
158 function resetCache() { 159 backCanvasMap.clear() 160 resetCanvasPool() 161 }
73 export async function resetCache() { 74 const url = process.env.CACHE_BASE_URL + resetCacheRoute; 75 const options = { method: 'POST', headers: { 'GraphCMS-WebhookToken': process.env.REFRESH_CACHE_TOKEN } }; 76 77 logger.debug(`Sending [${options.method}] "${url}" with headers "${JSON.stringify(options.headers)}"`); 78 const result = await fetch(url, options) 79 .then((res) => res.json()) 80 .catch((e) => { 81 logger.debug(`An unexpected error happened while fetching "${url}".`); 82 logger.error(e); 83 throw e; 84 }); 85 86 if (result.errors) { 87 logger.error(`${result.errors.length} error(s) were returned by "${url}":`); 88 map(result.errors, (e, index) => logger.error(` - [${index}] "${e.message}"`)); 89 } else { 90 logger.info(`${logSymbols.success} OK - Cache was reset/wiped`); 91 logger.info(`${logSymbols.info} Result:\n${JSON.stringify(result, null, 2)}`); 92 } 93 }
131 reset() { 132 this.editor.summernote('reset'); 133 }
32 public reset() { 33 if (!this.initialized) { 34 log.debug(':Cache:reset skipped, not initialized') 35 return 36 } 37 for (const coll of this.collections) { 38 coll.removeDataOnly() 39 } 40 }