Defining stores
All stores are defined inclient/src/store.tsx. To define a store, use the create Zustand function and export it from the store file. Here is an example with the flags:
flags) and a state change function (fetchFlags). This way, we don’t have to call the fetchFlags function if the flags don’t change between components.
Using stores
To use the store, we simply import it as follows (this is a simplifiedclient/src/components/admin/FlagsPopup.tsx):
Defined stores
There are a couple of existing defined stores in Jury (you shouldn’t need to add any more unless there’s a big change):- Admin Store: Used to store admin dashboard stats, list of projects, list of judges, and project/judge stats
- Clock Store: Stores the main judging clock state
- Options Store: Stores the options defined in the admin settings
- Flags Store: Stores all flags in Jury
- Admin Table Store: Stores projects/judges, as well as the current state of the table