store client in state, populate with active server

This commit is contained in:
austinried
2021-08-02 10:18:56 +09:00
parent 8b17ebe9c2
commit 6d30168ea0
4 changed files with 61 additions and 35 deletions

View File

@@ -34,9 +34,11 @@ export const useStore = create<Store>(
name: '@appStore',
getStorage: () => storage,
whitelist: ['settings'],
// onRehydrateStorage: state => {
// return (state, error) => {}
// },
onRehydrateStorage: _preState => {
return (postState, _error) => {
postState?.createClient()
}
},
},
),
)