Fetch, in most use cases, will require three states:
- START: A fetch start, which should cause isLoading to be true
- SUCCESS: Data was fetched successfully
- ERROR: Fetch could not retrieve data; an appropriate error message should be shown
The last state we need to handle is error. There are a few approaches to this with respect to user experience guidelines:
- Displaying an error message within the list—this provides a clear message for those who care about the data in the table. It may include a clickable link or a button to retry. You may mix this approach with the ones that follow.
- Displaying a floating notification about the failure—this shows the message about the error in one of the corners. The message may disappear ...