[ Javascript ] CTJS Note
Redux設計概念與實戰 Redux 簡報: http://slides.com/dmoon/redux-intro# Why SPA more complecated data跟view分開, 類似angular, data只有一份,data changed -> view changed React: data and view bind Problem: props傳遞地獄 Redux predictabble state container 三大原則 Single source of truth 單一資料來源 整個應用的state存在一顆object tree中,並放在唯一的container(state)內 State is read only 唯一改變state的方法就是觸發action(修改資料唯一方法) Redux Flow Produc -> 畫面需要改變 -> 產生action | Server <- action -> dispatch -> reducer ...