Flux हे एक आर्किटेक्चर पॅटर्न (Facebook कडून) आहे जो एकदिशीय (एकमार्गी) डेटा प्रवाह वापरून स्थिती व्यवस्थापित करते. हे Redux साठी संकल्पनात्मक आधार होते आणि बहुतेक आधुनिक state management लायब्ररींवर प्रभाव टाकला. मूल विचार: डेटा एक एकच, अंदाजे करता येणारी दिशेने वाहतो.
एकदिशीय चक्र
Action → Dispatcher → Store → View
↑ │
└───────────────────────────────────┘
(user interaction creates a new Action)
1. Action — a plain object describing WHAT happened ({ type: 'ADD_TODO', text })
2. Dispatcher — a central hub that sends every action to the stores
3. Store — holds state + logic; updates itself in response to actions
4. View — renders from the store; user interactions dispatch new actions
