Book Image

Flux Architecture

By : Adam Boduch
Book Image

Flux Architecture

By: Adam Boduch

Overview of this book

Whilst React has become Facebook’s poster-child for clean, complex, and modern web development, it has quietly been underpinned by its simplicity. It’s just a view. The real beauty in React is actually the architectural pattern that handles data in and out of React applications: Flux. With Flux, you’re able to build data-rich applications that engage your users, and scale to meet every demand. It is a key part of the Facebook technology stack that serves billions of users every day. This book will start by introducing the Flux pattern and help you get an understanding of what it is and how it works. After this, we’ll build real-world React applications that highlight the power and simplicity of Flux in action. Finally, we look at the landscape of Flux and explore the Alt and Redux libraries that make React and Flux developments easier. Filled with fully-worked examples and code-first explanations, by the end of the book, you'll not only have a rock solid understanding of the architecture, but will be ready to implement Flux architecture in anger.
Table of Contents (21 chapters)
Flux Architecture
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Borrowing ideas from Flux


Flux forces us to think about the information architecture of our application in new and interesting ways. Rarely does adopting a new approach like this happen in a vacuum. The ideas tend to spread to other parts of the technology stack. With Flux, it's the architectural principles of data-flow direction and feature-driven information that stand out as having a positive impact. If these things can have a positive impact on the frontend code, why couldn't they influence the design of the system as a whole?

Unidirectional data flow

The unidirectional flow of data through a Flux architecture is probably the key aspect that enables it to scale. By itself, unidirectional data-flow makes the code we write easy to reason about. In places, this approach can be a little more verbose, but this is a conscious trade-off that we make in order to facilitate predictability. For example, with the two-way data binding capabilities found in some frameworks, we can get away with writing...