function update_styles(dom, prev = {}, next, priority) {
	for (var key in next) {
		var value = next[key];

		if (prev[key] !== value) {
			if (next[key] == null) {
				dom.style.removeProperty(key);
			} else {
				dom.style.setProperty(key, value, priority);
			}
		}
	}
}
@param {Element & ElementCSSInlineStyle} dom
@param {Record<string, any>} prev
@param {Record<string, any>} next
@param {string} [priority]