DEV Community

Discussion on: Opinionated React - Use Status Enums Instead of Booleans

Collapse
 
farazamiruddin profile image
faraz ahmad

This is also an interesting take! So you're saying instead of storing a separate enum string value, just derive the status based on whether or not data or error are not null?

The one case I could argue against this for is re-fetching. Say you have a list of data, and you'd like to re-fetch or fetch more...your original data wouldn't be null...therefore how could you indicate to the user that you were re-fetching / fetching more?