本文整理汇总了TypeScript中redux-devtools-extension/developmentOnly.composeWithDevTools函数的典型用法代码示例。如果您正苦于以下问题:TypeScript composeWithDevTools函数的具体用法?TypeScript composeWithDevTools怎么用?TypeScript composeWithDevTools使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了composeWithDevTools函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: configureStore
export default function configureStore(initialState: DeepPartial<RootState>) {
const sagaMiddleware = createSagaMiddleware();
const middleware = [
sagaMiddleware
];
const composeEnhancers = composeWithDevTools({});
const composedEnhancers = composeEnhancers(
applyMiddleware(...middleware)
);
const store = createStore(
rootReducer,
initialState,
composedEnhancers
);
for (const sagaKey of Object.keys(sagas)) {
sagaMiddleware.run(sagas[sagaKey]);
}
return store;
}
示例2: configureStore
export default function configureStore(initialState: DeepPartial<RootState>) {
const composeEnhancers = composeWithDevTools({});
const store = createStore(
createRootReducer(history),
initialState,
composeEnhancers(
applyMiddleware(
routerMiddleware(history)
)
)
);
return store;
}
示例3: configureStore
export default function configureStore(initialState: DeepPartial<RootState>) {
const middleware = [
thunk
];
const composeEnhancers = composeWithDevTools({});
const composedEnhancers = composeEnhancers(
applyMiddleware(...middleware)
);
const store = createStore(
rootReducer,
initialState,
composedEnhancers
);
return store;
}
示例4: composeWithDevTools
import { createStore, applyMiddleware } from 'redux'
import rootReducer, { RootState } from '../reducers'
import { composeWithDevTools } from 'redux-devtools-extension/developmentOnly'
import { loadingBarMiddleware } from 'react-redux-loading-bar'
import thunk from 'redux-thunk'
const composeEnhancers = composeWithDevTools({})
const rootStore = () => {
const store = createStore<RootState>(
rootReducer,
composeEnhancers(
applyMiddleware(
loadingBarMiddleware(),
thunk
)
)
)
return store
}
export default rootStore