Flux ایک تعمارت پیٹرن ہے (Facebook کی طرف سے) جو یک طرفہ (ایک سمت میں) ڈیٹا بہاؤ کے ساتھ state کو منظم کرنے کے لیے ہے۔ یہ Redux کے تصوری بنیاد تھا اور اکثر جدید state libraries کو متاثر کیا۔ بنیادی خیال: ڈیٹا ایک واحد، قابل پیش گوئی سمت میں بہتا ہے۔
یک طرفہ سائیکل
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
