kiến trúc flux
Post on 15-Jan-2017
334 Views
Preview:
TRANSCRIPT
Lại Đức Phương Email: laiducphuong83@gmail.com
Backend: PHP & MYSQL Frontend: JS, HTML, CSS
Kiến trúc Flux
MVC
Quan hệ quá nhiềuKhông thể kiểm soát
FluxKiểm soát các mối quan hệ
Action: Đăng ký các hàm View gọi khi cần
Dispatcher: Nút thắt cổ chai, vai trò trung chuyển từ Action đến Store
Store: Lưu trữ và xử lý dữ liệu
View: Lấy dữ liệu từ Store để hiện thị, lắng nghe sự thay đổi của Store
RefluxKhông có thành phần Dispatcher
Flux (Facebook)
• Actions
• Stores
• Components
• Dispatcher
• Constants
https://facebook.github.io/flux/
Examples
https://facebook.github.io/flux/docs/todo-list.html#content
https://github.com/facebook/flux/tree/master/examples/flux-todomvc/
https://github.com/facebook/flux/tree/master/examples
Show code
Redux
• Actions
• Constants
• Store
• Reducers
• Components
http://redux.js.org/
Examples
• http://redux.js.org/docs/introduction/Examples.html
• https://github.com/rackt/redux/tree/master/examples
Show code
React- Reduxhttp://redux.js.org/docs/basics/UsageWithReact.html
Bind Action vào trong component
Redux Devtool
Q & A
top related