_.debounce(function() { console.log("\x1b[2J"); console.log("\x1b[0;0H"); console.log(kleur.yellow().bold("\nRegistry: "), kleur.grey("Time:"), kleur.grey(humanize(process.uptime() * 1000))); console.log(kleur.yellow().bold( "========")); const nodeIDs = _.uniq([].concat( Object.keys(this.workerRegistry), this.broker.registry.nodes.toArray().map(node => node.id) )) .filter(nodeID => nodeID != this.broker.nodeID) .sort((a, b) => Number(a.replace(/[^\d]/g, "")) - Number(b.replace(/[^\d]/g, ""))); nodeIDs.forEach(nodeID => this.printWorkerRegistry(nodeID, this.workerRegistry[nodeID], nodeIDs)); }, 250)
constructor(...serviceConfig) { super(...serviceConfig); this.count = Object.assign({}, INITIAL_COUNT_VALUE); this.ready = false; this.db = this.loadDatabase(); this.emitUpdate = _.debounce(this.emitUpdate.bind(this), 100); this.countNotifications(); }
_.debounce(() => { broker.logger.info(kleur.bgMagenta().white().bold(`Reload ${needToReload.size} service(s)`)); needToReload.forEach(svc => { if (typeof svc == "string") return broker.loadService(svc); return hotReloadService(svc); }); needToReload.clear(); }, 500)
function watchProjectFolders() { const loadServices = _.debounce(() => { broker.logger.info(kleur.bgMagenta().white().bold(`Load ${needToLoad.size} service(s)...`));
QUnit.test('once with asynchronous events', function(assert) { var done = assert.async(); assert.expect(1); var func = _.debounce(function() { assert.ok(true); done(); }, 50); var obj = _.extend({}, Backbone.Events).once('async', func); obj.trigger('async'); obj.trigger('async'); });
render() { const searchVideo = _.debounce((term) => {this.searchVideo(term)}, 300); return ( <div> <SearchBar onSearchVideo={(term) => searchVideo(term)}/> <VideoDetail video={this.state.selectedVideo} /> <VideoList onSelectVideo={selectedVideo => this.setState({selectedVideo})} videos={this.state.videos} /> </div> ); }