当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript developmentOnly.composeWithDevTools函数代码示例

本文整理汇总了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;
}
开发者ID:stevejhiggs,项目名称:macgyver,代码行数:25,代码来源:configureStore.ts

示例2: configureStore

export default function configureStore(initialState: DeepPartial<RootState>) {
  const composeEnhancers = composeWithDevTools({});

  const store = createStore(
    createRootReducer(history),
    initialState,
    composeEnhancers(
      applyMiddleware(
        routerMiddleware(history)
      )
    )
  );

  return store;
}
开发者ID:stevejhiggs,项目名称:macgyver,代码行数:15,代码来源:configureStore.ts

示例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;
}
开发者ID:stevejhiggs,项目名称:macgyver,代码行数:18,代码来源:configureStore.ts

示例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
开发者ID:do7be,项目名称:lgtm-hub,代码行数:23,代码来源:index.ts


注:本文中的redux-devtools-extension/developmentOnly.composeWithDevTools函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。