stop() { if (!this.ref) { return; } clearInterval(this.ref); this.ref = null; }
destroy0() { clearTimeout(this.connectivityCheckStartTimeout); clearTimeout(this.respawnTimeout); clearInterval(this.connectivityCheckInterval); return this._send0({ type: 'destroy-actor' }, { receive: true }); }
// Called after webpack has finished generating the stats.json file function callback() { clearInterval(progress); process.stdout.write( '\n\nOpen ' + chalk.magenta('http://webpack.github.io/analyse/') + ' in your browser and upload the stats.json file!' + chalk.blue( '\n(Tip: ' + chalk.italic('CMD + double-click') + ' the link!)\n\n', ), ); }
Object.keys(timer).map((key) => { clearInterval(timer[key]) console.log(`Stop: ${key}`) })
componentWillUnmount() { clearInterval(this.interval); }
stop(cb) { if (this.interval) { clearInterval(this.interval); this.interval = null; return cb ? cb() : null; } }
const timerMiddleware = store => next => (action) => { const newAction = { ...action }; switch (action.type) { case 'START_TIMER': newAction.tickInterval = setInterval(() => store.dispatch({ type: 'TICK_TIMER' }), 1000); return next(newAction); case 'STOP_TIMER': clearInterval(store.getState().tickInterval); return next(newAction); case 'PAUSE_5SECS': console.log('initiating MW PAUSE_5SECS'); return setTimeout(() => next(newAction), 5000); default: } return next(newAction); }
/** * Enables remote endpoint monitoring. * * @private */ _monitorChild() { this.connectivityCheckStartTimeout = setTimeout(() => { this.connectivityCheckInterval = setInterval(() => { let lastPingTs = this._getLastReceiveTimestamp() || 0; let now = _.now(); if (now - lastPingTs > this.getSystem().getPingTimeout()) { this._setState('crashed'); this.getLog().warn('Attempting to respawn remote endpoint due to timeout...'); this.actorSocket && this.actorSocket.destroy(); clearInterval(this.connectivityCheckInterval); this._respawn(); } }, 1000); }, this.getSystem().getPingTimeout()); }
const AnimalContainer = ({ animals, berry, sortDirection, toggleFavorite, giveBerry, pruneBerries }) => { const [time, setTime] = useState(Date.now()); useEffect(() => { pruneBerries(Date.now()); const interval30Sec = setInterval(() => { setTime(Date.now()); pruneBerries(Date.now()); }, 20000); return () => clearInterval(interval30Sec); }, []); return ( <Animals animals={animals} sortDirection={sortDirection} toggleFavorite={toggleFavorite} giveBerry={giveBerry} time={time} berry={berry} /> ); }
static getHandler(url: string, token: AccessToken) { if (!SocketConnections.connections[url]) { console.log('Creating a new connection with: ', url); let config: any = { log: false, secure: false, forceWebsockets: true }; SocketConnections.connections[url] = SocketDriver.connect(url, config); SocketConnections.connections[url].on('connect', () => { if (!SocketConnections.configured) SocketConnections.setupConnection(url, token, config); }); let forceConfig: any = setInterval(() => { if (!SocketConnections.configured && SocketConnections.connections[url].connected) { console.info('Forcing IO Configuration'); SocketConnections.setupConnection(url, token, config); clearInterval(forceConfig); } else if (SocketConnections.configured) { clearInterval(forceConfig); } }, 1000) } else { console.log('Reusing existing connection: ', url); } return SocketConnections.connections[url]; }
componentWillUnmount() { if (this.__intervalHandle) { clearInterval(this.__intervalHandle); } }
clearInterval(checkTimer);
return function() { function t() { clearTimeout(n), clearInterval(r), e();
componentWillUnmount() { clearInterval(this.timer); }
componentWillUnmount() { clearInterval(this.intervalToUpdate); }