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

Returning promises

None of the action creator functions we've looked at so far in this chapter have returned any values. That's because their main job is to dispatch actions, while at the same time hiding any concurrency synchronization semantics. On the other hand, action creator functions could return a promise so that we could compose more complex asynchronous behavior that spans multiple stores. In the last section, we saw that composing asynchronous behavior using action creator functions can be difficult if not impossible to do.

In this section, we'll revisit the challenges posed by asynchronous behavior in the context of composing larger functionality. Then, we'll create an example implementation with action creators that return promises ...

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