componentDidMount() { const { props: { dispatch } } = this; this.loop = interval(() => { dispatch(dataUpdate(shuffle(ALPHABET) .slice(0, Math.floor(Math.random() * 26)) .sort())); }, BASE_DURATION * 1.5); }
export default function(callback, delay) { function tick(elapsed) { callback({timestamp: Date.now(), elapsed: elapsed}); } this._timers.push(interval(tick, delay)); }