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 ...

Get Flux Architecture now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.