Closed Menubrea closed 1 year ago
Updates
state slices
to be imported to be accessed by global state hook. Let me know what you think about the updated structure.
import { useStore } from '~/store'
// Destructured
const { count, increment } = useStore();
// alternatively using dot notation, which will expose all available properties as a list.
let count = useStore().count;
I'm a fan of the Destructured method
Looks good to me, I think Zustand will server are purposes for a small scale app. One thing I was wondering is will we need to use something like SWR or React Query for caching progress server side, although we can just update the database as checks are complete too, but might be something for consideration.
Looks good to me, I think Zustand will server are purposes for a small scale app. One thing I was wondering is will we need to use something like SWR or React Query for caching progress server side, although we can just update the database as checks are complete too, but might be something for consideration.
Absolutely, great input! Luckily for us tPRC's queries functions as a wrapper around React Query hooks. For any server data, I anticipate queries will be our go-to for caching and state-management.
store
folder with an a basic exampleStore.If anyone have any reservations on using
Zustand
, or would prefer a different library for ´State-management` and/or if there is anything specific you would like implemented at this point in time, please let me know.