-
Book Overview & Buying
-
Table Of Contents
Flux Architecture
By :
So far in this book, we've treated our Flux store dependencies implicitly. The order in which we imported the store modules determined the order in which actions were handled, which has implications if something we depend on hasn't been updated yet. It's time to start treating our store dependencies with a little more rigor.
In this section, we'll introduce the waitFor() mechanism of the Flux dispatcher to manage store dependencies. Then, we'll talk about two types of store dependencies we might have. The first type of dependency is strictly related to application data. The second type of dependency is related to UI elements.
The dispatcher has a built-in mechanism that allows us to explicitly resolve store dependencies. What's more, dependencies are declared right in the callback function, where the dependency is actually used. Let's look at an example that highlights the improved code for dealing with store dependencies. First, we have a basic...