How to use the react-addons-perf.stop function in react-addons-perf

To help you get started, we’ve selected a few react-addons-perf examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Restuta / rcn.io / src / shared / middlewares / react-perf-middleware.js View on Github external
export default store => next => action => {
  const key = `performance:${action.type}`
  Perf.start()

  // will re-render the application with new state
  const result = next(action)
  Perf.stop()

  console.group(key) //eslint-disable-line
  console.info('wasted') //eslint-disable-line
  Perf.printWasted()
  // any other Perf measurements you are interested in

  console.groupEnd(key) //eslint-disable-line
  return result
}
github amrav / sparrow / ui / src / socket.js View on Github external
const dispatchMessage = (msg) => {
    // let timer = profiler.start('dispatchMessage');
    Perf.start();
    if (msg.type === RECEIVE_MESSAGE) {
        store.dispatch(newTabMaybe('Hub', 'hubMessages', ''));
    } else if (msg.type === RECEIVE_PRIVATE_MESSAGE) {
        store.dispatch(newTabMaybe(msg.from, 'privateMessages', msg.from));
    }
    store.dispatch(msg);
    Perf.stop();
    const measurements = Perf.getLastMeasurements();
    // Perf.printInclusive(measurements);
    Perf.printExclusive(measurements);
    Perf.printWasted(measurements);
    // timer.stop('dispatchMessage');
};
github animachine / animachine / src / main.js View on Github external
setTimeout(function () {
    Perf.stop()
    Perf.printInclusive()
    Perf.printExclusive()
    Perf.printWasted()
    PPP.log()
  }, 200)
}
github strues / boldr / src / shared / components / PerfProfiler / PerfProfiler.js View on Github external
toggle = () => {
    const { started } = this.state;

    started ? Perf.stop() : Perf.start();

    this.setState({ started: !started });
  };
github liangklfangl / react-universal-bucket / src / containers / App / App.js View on Github external
return {
						    increase: (...args) => dispatch(actions.increase(...args)),
						    decrease: (...args) => dispatch(actions.decrease(...args))
						  }
						}
					但是我们整个应用中并没有actionCreator,所以在dispatch的时候是没有action这个plain对象的
					原因在于:我们在mapDispatchToProps中采用了对象而不是函数的情况,所以此时相当于直接执行这个
					函数,同时将函数的返回值直接dispatch出去。可以将component和redux解耦。
					注意:我们这里发出去的action会被clientMiddleware处理转化为真正的action
                 */}
              <footer>
             
			)
	}
}
Perf.stop();</footer>
github sheepsteak / react-perf-component / src / index.js View on Github external
componentDidUpdate() {
      ReactPerf.stop();

      const measurements = ReactPerf.getLastMeasurements();

      ReactPerf.printWasted(measurements);
      ReactPerf.start();
    }
github coinbay / CoinbayDEX / frontend / app / components / Tools.jsx View on Github external
componentDidMount: function() {
    if (this.props.flux.stores.config.debug && Perf) {
      var measurements = Perf.stop();
      Perf.printInclusive(measurements);
      utils.debug("Inclusive", "^");
      Perf.printExclusive(measurements);
      utils.debug("Exclusive", "^");
      Perf.printWasted(measurements);
      utils.debug("Wasted", "^");
    }
  },
github ssrwpo / ssr / demo / imports / ui / hoc / perf.jsx View on Github external
setTimeout(() => {
        Perf.stop();
        const measures = Perf.getLastMeasurements();
        Perf.printWasted(measures);
        Perf.printOperations(measures);
      }, 0);
    }
github strues / boldr / src / components / PerfProfiler / PerfProfiler.js View on Github external
toggle = () => {
    const { started } = this.state;

    started ? Perf.stop() : Perf.start();

    this.setState({ started: !started });
  };
github matt-deboer / kuill / pkg / ui / src / components / access / ResourcesTab.js View on Github external
componentDidUpdate = () => {
    Perf.stop()
    let m = Perf.getLastMeasurements()
    Perf.printWasted(m)

    if (!this.state.actionsOpen) {
      this.actionsClicked = false
    }
  }