Defining the requirement
Let's assume that we have components (C1, C2, C3, and C4) that do not have any relationship with each other and there is information (DATA) shared between those components:
The components can update DATA and consume it at the same time. But at any time during the process, the components should be able to access the last value of DATA.
Well, this is the requirement in an abstract way. Let's make it clearer with a concrete example.
In our RecipeApp
, when the user clicks on one recipe, it gets selected, and we want all the components to have access to the last-selected recipe by the user.