Skip to content

Commit 18e4dec

Browse files
committed
rename
1 parent 31b50df commit 18e4dec

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

packages/svelte/src/internal/client/dom/blocks/css-props.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import { render_effect } from '../../reactivity/effects.js';
33

44
/**
55
* @param {HTMLDivElement | SVGGElement} element
6-
* @param {() => Record<string, string>} props
6+
* @param {() => Record<string, string>} get_styles
77
* @param {(anchor: Element | Text | Comment) => any} component
88
* @returns {void}
99
*/
10-
export function css_props(element, props, component) {
10+
export function css_props(element, get_styles, component) {
1111
if (hydrating) {
1212
set_hydrate_nodes(
1313
/** @type {import('#client').TemplateNode[]} */ ([...element.childNodes]).slice(0, -1)
@@ -17,23 +17,23 @@ export function css_props(element, props, component) {
1717
component(/** @type {Comment} */ (element.lastChild));
1818

1919
/** @type {Record<string, string>} */
20-
let current_props = {};
20+
let styles = {};
2121

2222
render_effect(() => {
2323
render_effect(() => {
24-
const next_props = props();
24+
const next = get_styles();
2525

26-
for (const key in current_props) {
27-
if (!(key in next_props)) {
26+
for (const key in styles) {
27+
if (!(key in next)) {
2828
element.style.removeProperty(key);
2929
}
3030
}
3131

32-
for (const key in next_props) {
33-
element.style.setProperty(key, next_props[key]);
32+
for (const key in next) {
33+
element.style.setProperty(key, next[key]);
3434
}
3535

36-
current_props = next_props;
36+
styles = next;
3737
});
3838

3939
return () => {

0 commit comments

Comments
 (0)