Cleaning up the store

There are improvements we can make to on the store. There is no need to write all the code we do currently. In fact, there are libraries out there that do a better job of handling certain functionality.

Before we apply all those changes we have in mind, let's recap what our store can do and what features still need to be in place after the cleanup work.

Let's remind ourselves, what our store is capable of so far:

  • Handles state changes: It handles the state changes; the store is able to change the state regardless of whether it is creating, updating, listing, or removing state.
  • Subscribable: It lets you subscribe to it; it's important for the store to have a subscription functionality so a view, for example, can listen to the store's state when it changes. A suitable reaction by the view is, for example, rerendering based on new data.
  • Can communicate a state change: It can send an event that its state has been changed; this goes together with being able to subscribe to the store, but this is the very act of actually notifying a listener that a state has changed.