This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.prototype.diff = function (a) { | |
return this.filter(function (i) { | |
return a.indexOf(i) === -1; | |
}); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isRestUrl() { | |
$bIsRest = false; | |
if ( function_exists( 'rest_url' ) && !empty( $_SERVER[ 'REQUEST_URI' ] ) ) { | |
$sRestUrlBase = get_rest_url( get_current_blog_id(), '/' ); | |
$sRestPath = trim( parse_url( $sRestUrlBase, PHP_URL_PATH ), '/' ); | |
$sRequestPath = trim( $_SERVER[ 'REQUEST_URI' ], '/' ); | |
$bIsRest = ( strpos( $sRequestPath, $sRestPath ) === 0 ); | |
} | |
return $bIsRest; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MeasureRender extends React.Component { | |
constructor() { | |
super(); | |
this.mounted = false; | |
} | |
render() { | |
const { name } = this.props; | |
if (this.mounted) { | |
window.performance.mark(`${name}UpdateStart`); |
OlderNewer