Skip to content

Commit 0529924

Browse files
committed
cleanup: remove unecessary lazy function
1 parent 8d2cf23 commit 0529924

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/base/plugin/addStyle.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,10 @@ import { registerModule } from 'src/utils/plugin.js';
44

55
wrap(() => {
66
const name = 'addStyle';
7-
let style;
8-
9-
function getStyle(plugin) { // Lazy initialize style, so as to not clutter the dom
10-
if (!style) {
11-
style = newStyle(plugin);
12-
}
13-
return style;
14-
}
157

168
function mod(plugin) {
17-
return (...styles) => getStyle(plugin).add(...styles);
9+
const style = newStyle(plugin);
10+
return (...styles) => style.add(...styles);
1811
}
1912

2013
registerModule(name, mod);

0 commit comments

Comments
 (0)