patchStyles keeps an element’s inline styles aligned with style data from old and new virtual nodes. It compares the two style objects, removes obsolete styles, and applies new or changed values. section 8.2.5
Style synchronization
function patchStyles(el, oldStyle = {}, newStyle = {}) { const { added, removed, updated } = objectsDiff(oldStyle, newStyle); for (const style of removed) removeStyle(el, style); for (const style of added.concat(updated)) setStyle(el, style, newStyle[style]); }
