In a redux store, for example if I store customers data as:
{
data: [1, 2, 3],
customers: {
1: { ... },
2: { ... },
3: { ... }
}
}
In a component, when I try to display customer with id 4, seeing that this customer doesn't exist in the store, I would attempt to fetch this customer using an API call. Now, assume that customer 4 in fact doesn't exist in the back-end database. At the end of the API call, the store is updated and customer 4 is still not in the store.
My question is, from the component, this doesn't tell me whether the customer has not been loaded (in that case I will need to load again), or that the customer in fact does not exist in the back-end database (in that case I will need to display an appropriate message). How is this usually handled in Redux?