Skip to content

Instantly share code, notes, and snippets.

View saifelse's full-sized avatar

Saif Hakim saifelse

View GitHub Profile

Keybase proof

I hereby claim:

  • I am saifelse on github.
  • I am saifelse (https://keybase.io/saifelse) on keybase.
  • I have a public key ASDQmSxEpkQFTGBpm_uopzcGjt9MS3zwgo1fmEIimsja4go

To claim this, I am signing this object:

React = require 'react'
Perf = require 'react-addons-perf'
ReactDOM = require 'react-dom'
rd = React.DOM
###
Usage: `require('debug/RecordPerfButton').attachToDOM()`
Add to any file to attach a record button to the DOM, toggleable via click and <alt> keypress.
Useful for quickly testing performance as it will:
@saifelse
saifelse / ReactPerfTester.js
Created August 25, 2016 08:43
Example of how to use react-addons-perf in tests
/* eslint-disable no-console */
import Perf from 'react-addons-perf';
import sinon from 'sinon';
/**
* Counts the number of DOM operations that occurred while executing `fn`.
*
* Example usage:
# import React from 'react';
# import ReactDOM from 'react-dom';