Skip to content

Commit 956ee07

Browse files
Update to client simple type logic
1 parent 0d3de87 commit 956ee07

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

client/index.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const convertValue = function (value, type) {
3232
}
3333

3434
function isSimple (item) {
35-
return item.type !== 'object' && item.type !== 'array'
35+
return item.type === 'number' || item.type === 'string' || item.type === 'boolean'
3636
}
3737

3838
const superviews = (options, Base = window.HTMLElement) => class Superviews extends Base {
@@ -100,9 +100,13 @@ const superviews = (options, Base = window.HTMLElement) => class Superviews exte
100100
return typeof val === 'undefined' ? dflt : val
101101
},
102102
set (value) {
103-
const old = val
104-
val = convertValue(value, item.type)
105-
this.propertyChangedCallback(key, old, val)
103+
const oldval = val
104+
const newval = convertValue(value, item.type)
105+
106+
if (newval !== oldval) {
107+
val = newval
108+
this.propertyChangedCallback(key, oldval, newval)
109+
}
106110
}
107111
})
108112
}

0 commit comments

Comments
 (0)