File tree Expand file tree Collapse file tree
packages/react/src/stores Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,16 +6,6 @@ type StoreChangeEvent = (newTheme: Theme) => void
66
77const 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-
199function 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+
5454export const createThemeStore : typeof createClientThemeStore =
5555 typeof window === 'undefined'
5656 ? ( createServerThemeStore as unknown as typeof createClientThemeStore )
You can’t perform that action at this time.
0 commit comments