2016年9月28日 星期三

redux tools 工具設定

https://github.com/zalmoxisus/redux-devtools-extension

有用到 middleware

1.2 Advanced store setup

If you setup your store with middleware and enhancers, change this:
  import { createStore, applyMiddleware, compose } from 'redux';

  let store = createStore(reducer, initialState, compose(
    applyMiddleware(...middleware)
  ));
to this:
  let store = createStore(reducer, initialState, compose(
    applyMiddleware(...middleware),
    window.devToolsExtension ? window.devToolsExtension() : f => f
  ));