File "index.js"
Full path: /home/webcknlt/admissiontell.com/wp-content/plugins/generateblocks/src/utils/should-rebuild-css/index.js
File
size: 478 B (478 B bytes)
MIME-type: text/x-java
Charset: utf-8
Download Open Edit Advanced Editor &nnbsp; Back
import { isEqual } from 'lodash';
function compareAttributes( prevAttributes, nextAttributes ) {
return Object.keys( prevAttributes ).every( ( key ) => {
return isEqual( prevAttributes[ key ], nextAttributes[ key ] );
} );
}
export default function shouldRebuildCSS( prevProps, nextProps ) {
return (
prevProps.deviceType === nextProps.deviceType &&
prevProps.clientId === nextProps.clientId &&
compareAttributes( prevProps.attributes, nextProps.attributes )
);
}