InfoJobs DevBoard uses Zustand 5 for all global client state. Zustand was chosen because it requires noDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/mauroperez055/infoJobs/llms.txt
Use this file to discover all available pages before exploring further.
Provider wrapper around the component tree — each store is simply a custom hook that any component can import and call directly. Stores are created with Zustand’s create factory, which accepts a callback that receives set and get helpers for updating and reading state.
Neither store persists state to
localStorage or any other storage mechanism. All state is held in memory and is lost when the page is refreshed.authStore
TheauthStore tracks whether the current user has authenticated. It is the single source of truth consulted by ProtectedRoute, Header, JobCard, and the Login / Register pages.
Source
State and actions
| Name | Type | Description |
|---|---|---|
isLoggedIn | boolean | true when the user has logged in during this session |
login() | action | Sets isLoggedIn to true |
logout() | action | Sets isLoggedIn to false |
Usage in a component
favoriteStore
ThefavoriteStore maintains the list of job IDs that the user has saved as favourites. The favourite count is displayed in the Header nav link, and individual JobCard and DetailPageHeader components use it to show a filled or empty heart icon.
Source
State and actions
| Name | Type | Description |
|---|---|---|
favorites | string[] | Array of saved job IDs |
addFavorite(id) | action | Adds id to favorites if not already present (idempotent) |
removeFavorite(id) | action | Removes id from favorites |
isFavorite(id) | selector | Returns true if id is in favorites |
toggleFavorite(id) | action | Calls addFavorite or removeFavorite based on current state |
countFavorites() | derived state | Returns the total number of saved job IDs |
Usage in a component
Displaying the favourite count
TheHeader component reads countFavorites() to show a live badge next to the profile link: