perf(class): prevent redundant calls to classList.remove (#634)

Fixes #633.

Co-authored-by: Simon Friis Vindum <simonfv@gmail.com>
pull/639/head
Shahar Dawn Or 5 years ago committed by GitHub
parent c771650f42
commit 22a9fe48db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -16,7 +16,11 @@ function updateClass (oldVnode: VNode, vnode: VNode): void {
klass = klass || {}
for (name in oldClass) {
if (!klass[name]) {
if (
oldClass[name] &&
!Object.prototype.hasOwnProperty.call(klass, name)
) {
// was `true` and now not provided
elm.classList.remove(name)
}
}

Loading…
Cancel
Save