scheduleRefresh( props ) { if ( ! this.shouldRefresh( props ) ) { return; } // Request a refresh one second before the current lock expires this._refresh = setTimeout( () => { this._refresh = null; this.requestLock( props ); }, props.expires - new Date().getTime() - 1000 ); }
event.dispatcher.on(event.step.after, (step) => { if (config.methods.indexOf(step.helperMethod) < 0) return; // skip non-actions recorder.add('auto-delay', async () => { if (store.debugMode) return; // no need to delay in debug log(`Delaying for ${config.delayAfter}ms`); return new Promise((resolve) => { setTimeout(resolve, config.delayAfter); }); }); });
setTimeout(function() { var input = ReactDOM.findDOMNode(self.refs.sessionsRemoteUrl); input.focus(); input.select(); }, 500);
$(window).on('resize', function() { timeout && clearTimeout(timeout); timeout = null; timeout = setTimeout(resize, 30); });
var cb = function() { if (chunk && self._speed) { setTimeout(function() { callback(null, chunk); }, Math.round(chunk.length * 1000 / self._speed)); } else { callback(null, chunk); } }
// Init updaters when intro animation is done setTimeout(() => { this.updateLoc(); this.locUpdater = setInterval(() => { this.updateLoc(); }, 1000); this.updateConns(); this.connsUpdater = setInterval(() => { this.updateConns(); }, 3000); }, 4000);
getData(key) { return new Promise((resolve, reject) => { setTimeout(() => { resolve(this.cache.get(key)); }, 100); }); }
setTimeout(() => { this.setState({ highLightedActions: { [`${columnIndex}:${rowIndex}`]: false } }); }, 500);
const showAlert = ({ dispatch }, msg) => { dispatch('SHOW_ALERT', msg) setTimeout(() => { dispatch('HIDE_ALERT') }, 3000) }
app.get('/throw', function* () { this.body = 'foo'; setTimeout(() => { a.b = c; }, 1); });
events.on('deleteValues', function(e, item) { setTimeout(function() { self.removeValues(item); }, 0); });
/** * {{> wait }} */ async wait(sec) { return new Promise(((done) => { setTimeout(done, sec * 1000); })); }
async function msleep(ms) { return new Promise((resolve) => { setTimeout(() => { resolve(); }, ms); }); }
/** * {{> wait }} */ async wait(sec) { return new Promise(((done) => { setTimeout(done, sec * 1000); })); }
const asyncwork = () => { return new Promise((resolve, reject) => { setTimeout(resolve, 1000) }) }