Skip to content

Commit 5a9c4b8

Browse files
committed
Refactor
1 parent 26b2fd4 commit 5a9c4b8

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

packages/react/src/stores/theme-store.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,6 @@ type StoreChangeEvent = (newTheme: Theme) => void
66

77
const initTheme = null
88

9-
export function createServerThemeStore(): ReturnType<
10-
typeof createClientThemeStore
11-
> {
12-
return {
13-
get: () => initTheme,
14-
set: () => {},
15-
subscribe: () => () => {},
16-
} as unknown as ReturnType<typeof createClientThemeStore>
17-
}
18-
199
function createClientThemeStore() {
2010
const el = document.documentElement
2111
const subscribers: Set<StoreChangeEvent> = new Set()
@@ -51,6 +41,16 @@ function createClientThemeStore() {
5141
}
5242
}
5343

44+
export function createServerThemeStore(): ReturnType<
45+
typeof createClientThemeStore
46+
> {
47+
return {
48+
get: () => initTheme,
49+
set: () => {},
50+
subscribe: () => () => {},
51+
} as unknown as ReturnType<typeof createClientThemeStore>
52+
}
53+
5454
export const createThemeStore: typeof createClientThemeStore =
5555
typeof window === 'undefined'
5656
? (createServerThemeStore as unknown as typeof createClientThemeStore)

0 commit comments

Comments
 (0)