%%{init: {"theme": "base", "themeVariables": {"primaryColor": "#fabd2f", "primaryTextColor": "#282828", "primaryBorderColor": "#b57614", "lineColor": "#7c6f64", "secondaryColor": "#83a598", "tertiaryColor": "#b8bb26", "background": "#fbf1c7", "mainBkg": "#ebdbb2", "fontFamily": "Tahoma, sans-serif"}}}%% flowchart LR subgraph Era1["ยุค Component หนัก / Fat Component"] A["Logic อยู่ใน Componentดูแลยาก"] end subgraph Era2["ยุค Service Layer / Service Pattern"] B["แยก LogicSeparation of Concerns"] C["Shared Dataแชร์ข้อมูลข้าม Component"] end subgraph Era3["ยุค Reactive State / RxJS State"] D["BehaviorSubjectเก็บค่าล่าสุด"] E["Observable StateSubscribe เพื่ออัปเดต UI"] end A --> B --> C --> D --> E
%%{init: {"theme": "base", "themeVariables": {"primaryColor": "#fabd2f", "primaryTextColor": "#282828", "primaryBorderColor": "#b57614", "lineColor": "#7c6f64", "secondaryColor": "#83a598", "tertiaryColor": "#b8bb26", "background": "#fbf1c7", "mainBkg": "#ebdbb2", "fontFamily": "Tahoma, sans-serif"}}}%% flowchart LR A["Component Aผู้แก้ข้อมูล"] --> B["UserServiceShared State"] B --> C["BehaviorSubjectค่าล่าสุด"] C --> D["Component Bผู้แสดงผล"] C --> E["Component Cผู้ใช้ข้อมูลร่วม"]