Book Image

React.js Essentials

By : Artemij Fedosejev
Book Image

React.js Essentials

By: Artemij Fedosejev

Overview of this book

Table of Contents (18 chapters)
React.js Essentials
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 10. Prepare Your React Application for Painless Maintenance with Flux

The reason why we decided to implement the Flux architecture in our React application is that we wanted to have a data flow that is easier to maintain. In the previous chapter, we implemented AppDispatcher, TweetActionCreators, and TweetStore. Let's quickly re-cap what they are used for:

  • TweetActionCreators creates and dispatches the actions

  • AppDispatcher dispatches all the actions to all stores

  • TweetStore stores and manages the application data

The only missing parts in our data flow are bits of functionality that are as follows:

  • Use TweetActionCreators to create the actions and start the data flowing

  • Use TweetStore to get data

Here are some important questions to ask: Where in our application does the data flow start? What is our data? If we answer these questions, we will understand where to start refactoring our application to adapt to the Flux architecture.

Snapterest allows users to receive and collect the latest...