Flux هي نمط معماري (من Facebook) لإدارة الحالة بـ تدفق بيانات أحادي الاتجاه (في اتجاه واحد). كانت الأساس المفاهيمي لـ Redux وأثرت على معظم مكتبات الحالة الحديثة. الفكرة الأساسية: البيانات تتدفق في اتجاه واحد، يمكن التنبؤ به.
دورة تدفق أحادية الاتجاه
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
