zustand and fetching #2538
Unanswered
Sebastian-Nielsen
asked this question in
Q&A
Replies: 1 comment
-
It might not be as beautiful as you'd expect: const useFooStore = create((set) => ({
result: { loadingStatus: 'loading' } as Async<MyType>,
doFetch: () => /* ... */,
})); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How would you go about having a zustand store that stores the result of a fetch when you are under these circumstances:
Async<T>
.(Ideally, the zustand store should use the immer middleware)
At this point, I think it's near impossible to have my zustand store conform to the
Async<T>
type. I am hoping someone can prove me wrong or at the very least guide me in the right direction. 😀Beta Was this translation helpful? Give feedback.
All reactions