Tinkoff/tramvai

How can this be distinguished from the situation when an empty array has arrived?

Closed this issue · 1 comments

polRk commented

// If the list is empty, consider that it is still loading

Hello!

For real-world cases, I can recommend a few options:

  1. Use react-query for API requests, there will be a useful flags for request current state
  2. More classic, "redux-like" option, add some flag to PokemonsStore, e.g. isFetching, and some events like requestStart, requestSuccess and requestFail. It can be a different store, for performance reason.