311-data
311-data copied to clipboard
Refactor code to have a single state variable keep track of application status
Overview
Currently, our app makes use of several different redux state variables to keep track of different application states such as isDbLoading
, isMapLoading
and an error
object (see: /redux/reducers/data.js#L137).
To prevent impossible states, mitigate the misuse of and the need to maintain disparate state variables throughout our codebase, it may be prudent to combine these multiple state variables into a single state variable called status
with each value represented by an ENUM value describing the application's current state.
This would allow our components to operate on a single source of truth and avoid potential bugs
We would like a volunteer take a look at refactoring our code to make this change and apply it throughout the codebase
The Concept
Action Items
- [x] See where in our code we are making use of
isMapLoading
,isDbLoading
anderror
object defined in /redux/reducers/data.js#L137 - [ ] See whether it is possible to combine these states into a single state variable called
status
and create a new status as an ENUM that corresponds to the given application state (refer toThe Concept
above) - [ ] Add/remove any statuses as needed
- [ ] Update all instance throughout the codebase to make use of this new single state variable