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

Mocking data

The dispatcher in Flux architectures is the single point of entry for new data entering the system. This makes it easy to fabricate mock data to help us churn out features faster. In this section, we'll discuss mocking existing APIs, and whether or not this is worthwhile to build into the action creator functions that talk to them. Then, we'll go over implementing mocks for new APIs that doesn't yet exist, followed by a look at strategies to substitute mock action creators for the real deal.

Mocking existing APIs

In order to mock data in a Flux system, the actions that are dispatched need to deliver this mock data to the stores. This is done by creating an alternative implementation of the action creator function that dispatches the ...

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