Top Banner
Flux for React By : Badr Uz Zaman
13

Flux architecture

Apr 15, 2017

Download

Software

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Flux architecture

Flux for React

By : Badr Uz Zaman

Page 2: Flux architecture

What is React?A JavaScript Library to Build UI

Build UIRespond to Events (events come from where?)Re-render UI on each change

Page 3: Flux architecture

Flux Is an architecture that complements React and the concept

of Unidirectional Data Flow Manages Application state with the help of Events Uses Dispatcher library and Node Event Emitter module

to setup event system

Page 4: Flux architecture

Flux Components Actions (Helper methods that facilitate passing data to the Dispatcher) Dispatcher (Receives actions and broadcasts payloads to registered

callbacks) Stores(Containers for application state & logic that have callbacks

registered to the dispatcher) Controller Views (React Components that grab the state from Stores and pass it

down via props to child components)

Page 5: Flux architecture

Flux Data Flow

Page 6: Flux architecture

Flux Dispatcher The Dispatcher is basically the manager of this entire

process. It is the central hub for your application. The dispatcher receives actions and dispatches the actions and data to registered callbacks.

Page 7: Flux architecture

Flux Dispatchers

Page 8: Flux architecture

Flux Store In Flux, Stores manage application state for a particular

domain within your application. From a high level, this basically means that per app section, stores manage the data, data retrieval methods and dispatcher callbacks.

Page 9: Flux architecture

Flux Store

Page 10: Flux architecture

Flux Controller View Controller views are really just React components that listen

to change events and retrieve Application state from Stores. They then pass that data down to their child components via props

Page 11: Flux architecture

Putti

ng A

ll To

geth

er

Page 12: Flux architecture

• https://scotch.io/tutorials/getting-to-know-flux-the-react-js-architecture

References

Page 13: Flux architecture

Thank You