In this particular example, I’m trying to determine whether to display a loading icon, the successful result, or the error result.
The solution that I came up with was having an enum that reflects these states stored on the component, and updating that:
- Initial load or reloads changes UI state Loading
- Successful load changes UI state to Succeeded
- Error load changes UI state to Failed
That sounds like what you are suggesting, I just didn’t know if there was a more elegant solution.