Overview
TMT uses Redux Toolkit for state management with Redux Persist for automatic state persistence to local storage. The store is configured with custom middleware to handle serialization and persistence actions.Store Configuration
The Redux store is configured usingconfigureStore from Redux Toolkit with persistence support.
Basic Setup
Store.js:84-92
Redux Persist Configuration
Redux Persist automatically saves and rehydrates the Redux state to/from local storage.Persist Configuration
Store.js:45-49
The key used to store the persisted state in storage
The storage engine to use (defaults to localStorage)
Array of reducer keys to persist. Only
auth, customizer, and setup states are persisted across sessionsPersisted Reducer
Store.js:82
persistReducer to enable automatic persistence.
Middleware Configuration
The store uses custom middleware configuration to handle non-serializable values in Redux Persist actions.Serialization Check
The middleware ignores Redux Persist action types to prevent serialization warnings:FLUSH- Flush pending state to storageREHYDRATE- Rehydrate persisted statePAUSE- Pause persistencePERSIST- Trigger persistencePURGE- Clear persisted stateREGISTER- Register reducers
Store.js:86-91
Root Reducer
The root reducer combines all slice reducers into a single reducer tree.Store.js:51-80
State Tree Structure
UI customization settings (persisted)
Application setup configuration (persisted)
Authentication state and user information (persisted)
Staff users management state
Collaborators management state
Client users management state
Customer users management state
Contracts management state
Contract addendums management state
Event tickets management state
Ticket query and search state
Event venues management state
Events management state
User credentials management state
Transactions management state
Box offices management state
Active office events state
Office-specific transactions state
Payment methods configuration state
Payout methods management state
Custody accounts management state
Orders management state
Office collaborators management state
Legal contracts management state
Order payouts management state
Customer portals management state
Documents management state
Marketing campaigns management state
Usage
Importing the Store
Accessing State
Dispatching Actions
Best Practices
Keep Actions Serializable
Avoid storing non-serializable values (functions, promises, etc.) in Redux state. Use middleware or side effects for async operations.
Use Selectors
Create reusable selectors to access state values and avoid duplicating logic across components.
Minimal Persistence
Only persist essential state (auth, settings) to avoid storage bloat. Most data should be fetched on demand.
Type Safety
Consider using TypeScript with Redux Toolkit for better type safety and autocomplete support.