Event Registration Store
Component Detail
Data Layer
low complexity
mobile
0
Dependencies
1
Dependents
1
Entities
0
Integrations
Description
Riverpod/BLoC state container that tracks per-event registration status for the current user, including optimistic pending states and confirmed/failed outcomes. Caches registration state locally to provide instant feedback on revisiting the event detail or listing screens. Invalidated on confirmed API response to stay consistent with server state.
event-registration-store
Responsibilities
- Maintain a map of eventId → RegistrationState (unregistered, pending, registered, error)
- Apply and roll back optimistic state mutations during in-flight API calls
- Persist confirmed registration state across screen navigations within the session
- Invalidate and refresh state after confirmed API success or failure
Interfaces
getState(eventId: string): RegistrationState
setOptimisticPending(eventId: string)
confirmRegistration(eventId: string, registration: EventRegistration)
revertToUnregistered(eventId: string)
setError(eventId: string, error: RegistrationError)
clearAll()
watchState(eventId: string): Stream<RegistrationState>