我正在使用redux和redux devtool 我刚刚尝试过 redux-form: 干得好,用起来很有趣!但是,我猜每次我修改一个字段时,应用程序状态都会改变。redux devtool保存在字段中点击的每个新键。它会大大减慢现场刷新速度!
这是显示应用程序状态更改的 redux devtool 停靠面板:
这是我将 redux-devtool 链接到我的应用商店的方法:
const createStoreWithMiddleware = (() => {
//DEv too only available in development
if (__DEV__ && window && window.location) {
return compose(
applyMiddleware(thunk),
devTools.instrument(),
persistState(
window.location.href.match(/[?&]debug_session=([^&]+)\b/)
)
)(createStore);
} else {
return compose(
applyMiddleware(thunk)
)(createStore);
}
})();
function configureStore(initialState) {
const store = createStoreWithMiddleware(rootReducer, initialState);
if (module.hot) {
// Enable Webpack hot module replacement for reducers
module.hot.accept("./reducers", () => {
const nextReducer = require("./reducers");
store.replaceReducer(nextReducer);
});
}
return store;
}
var appStore = configureStore();
export default appStore;
我想找到一种方法来避免让 redux 开发工具获取 redux-form 更改。欢迎任何更好的解决方案:)