Chapter 9. Expanding existing Rx apps
In this chapter
- Expanding an existing Rx app to have new features
- Persisting and loading application state
- Moving parts of a view model logic into a dedicated model
One of the advantages of Rx is that adding new functionality to an application is relatively straightforward if the code is structured properly. What you need to do is to carefully think about what you want to change and then reshape the graph accordingly.
In this chapter, you’ll take a piece of code you already wrote and identify the points where your new goals diverge from the old ones.
You’ll be exploring how reactive programming makes the application modular—the chain is just a combination of independent functions—and how to utilize the existing modules.
You’ll start from a working game of tic-tac-toe, which you already saw in the preceding chapter. Don’t worry if you don’t remember the details, because you’ll revise the implementation before you start applying changes.
This is how the game you already have looks:
In this simple game, the players in turn insert either a cross or a circle. The player who gets three markers in a line wins.