Skip to content

Commit 9ef4386

Browse files
committed
added deep object comparison for state change and async state render call behavoir
1 parent 7e7c2a7 commit 9ef4386

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

OpenScript.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1744,7 +1744,7 @@ var OpenScript = {
17441744
* @param {...any} args
17451745
* @returns
17461746
*/
1747-
fire(...args) {
1747+
async fire(...args) {
17481748

17491749
for(let [k, component] of this.listeners){
17501750
component.wrap(...args, this.signature);
@@ -1798,8 +1798,15 @@ var OpenScript = {
17981798
set(target, prop, value) {
17991799

18001800
if(prop === "value") {
1801+
let current = target.value;
1802+
let nVal = value;
18011803

1802-
if(target.value === value) return true;
1804+
if(typeof current === "object"){
1805+
current = JSON.stringify(current);
1806+
nVal = JSON.stringify(nVal);
1807+
}
1808+
1809+
if(current === nVal) return true;
18031810

18041811
Reflect.set(...arguments);
18051812

0 commit comments

Comments
 (0)