orchestra-components
Advanced tools
Comparing version 0.6.1 to 0.6.2
@@ -116,2 +116,30 @@ // import { patch } from 'incremental-dom'; | ||
} | ||
shouldComponentUpdate() { | ||
let isDirty = false; | ||
if (this.currentData) { | ||
for (const prop in this.data) { | ||
if (Array.isArray(this.data[prop])) { | ||
const isEqual = this.data[prop].every((element, index) => element === this.currentData[prop][index]); | ||
if (!isEqual) { | ||
isDirty = true; | ||
break; | ||
} | ||
} else { | ||
if (this.data[prop] !== this.currentData[prop]) { | ||
isDirty = true; | ||
break; | ||
} | ||
} | ||
} | ||
} else { | ||
isDirty = true; | ||
} | ||
this.currentData = this.data; | ||
return isDirty; | ||
} | ||
} |
{ | ||
"name": "orchestra-components", | ||
"version": "0.6.1", | ||
"version": "0.6.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
11443
283