Appendix A: Design the State Data Shape of Your Application
A good design of your application is crucial in many cases. It would enable you to access the data more efficiently and in a more natural manner. In contrast, some designs may lead you to do unnecessary for-loops or use too many levels in a tree to fetch the data you want. In this chapter, we will discuss how we can refactor the current data structure into a new one that may help us to organize code neater and easy to understand.
Before jumping directly into the reshaping, let’s first take a close look at how we handle errors in the whole application.
Error Handling
In a perfect world, everything goes well. The network is reliable, APIs always return whatever you’re requesting, and it is ...