O'Reilly logo

Flux Architecture by Adam Boduch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building a dispatcher module

In this section, we're going to implement our own dispatcher module. This will serve as a replacement for the Facebook reference implementation that we've relied upon so far in this book. First, we'll think about how the dispatcher will track references to store modules. Then, we'll discuss the functions that this module needs to expose, followed by a walk-through of the dispatch() implementation. Lastly, we'll figure out how we want to handle dependency management with this dispatcher module.

Encapsulating store references

The first aspect of our dispatcher module to consider are the stores themselves. With Facebook's reference implementation, there are no references to stores—only references to callback functions. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required