Using MobX for FavoritedImages
At the beginning of this book, I made a choice, my dear reader, to write all examples in JavaScript. I have come to regret that decision while working on the examples with MobX. MobX documentation uses TS, a JavaScript superset, which brings many advantages. I encourage you my dear reader to learn about TS. I will not spend any more time on this topic as there are hundreds of hugely valuable TS resources both online and in book form, but I wanted to let you know, in case you read the MobX documentation, that the examples look a little different from the code in this book.
Now that we have all of this out of the way, let’s get to coding! We will create a new folder called models
where we will store data models for our app. The term “data models” may sound very serious to you, but don’t worry. MobX data models are nothing more than JavaScript objects with superpowers – by which I mean to say, they look like simple JavaScript...