O'Reilly logo

Hands-On Design Patterns with React Native by Mateusz Grzesiukiewicz

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

Flux by example

Before we dive in-depth into Flux, let's create a simple application using the Flux architecture. For this, we will use the Flux library provided by Facebook. The library includes all of the pieces we will need to make the application tick according to the new Flux flow. Install Flux and the immutable libraries. immutable is also crucial for further advantages as we become more familiar with Flux:

yarn add flux immutable

The application we will build in Flux is a Tasks application. The one we have already created will need some tweaking. The first thing to do is create the Dispatcher, Tasks Store, and Task Actions.

The Flux package provides the base for our architecture. For instance, let's instantiate Dispatcher for our Tasks ...

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