Skip to content

Commit

Permalink
refactor: Themes emitter SSR initialization (#1449)
Browse files Browse the repository at this point in the history
  • Loading branch information
rkaraivanov authored Oct 25, 2024
1 parent 78663a1 commit 497e022
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/theming/theming-event.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { isServer } from 'lit';
import type { Theme, ThemeVariant } from './types.js';

class ThemeChangedEmitter extends EventTarget {
constructor() {
super();
globalThis.addEventListener(CHANGE_THEME_EVENT, this);
if (!isServer) {
globalThis.addEventListener(CHANGE_THEME_EVENT, this);
}
}

public handleEvent() {
Expand Down

0 comments on commit 497e022

Please sign in to comment.