Unidirectional Data Flow

Many of the remaining examples in this book employ a unidirectional data flow pattern. Popularized by Redux in the world of Web app development, adopting a unidirectional data flow can help simplify how different bits of your app work with that data.

While the details will differ somewhat by implementation, the general approach of a unidirectional data flow (UDF) is to minimize the number of places in the app that can change data. In particular, while a user interface may allow the user to change data, the GUI code itself does not change data, but instead works off of a stream of immutable objects as a source of details for what to render in the GUI itself.

In particular, the UDF approach that will be used in most of the remaining book samples will look a bit like this:

A Unidirectional Data Flow
A Unidirectional Data Flow

In a nutshell:


Prev Table of Contents Next

This book is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license.