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


TypeScript DevToolsExtension.enhancer方法代码示例

本文整理汇总了TypeScript中@angular-redux/store.DevToolsExtension.enhancer方法的典型用法代码示例。如果您正苦于以下问题:TypeScript DevToolsExtension.enhancer方法的具体用法?TypeScript DevToolsExtension.enhancer怎么用?TypeScript DevToolsExtension.enhancer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@angular-redux/store.DevToolsExtension的用法示例。


在下文中一共展示了DevToolsExtension.enhancer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: constructor

  constructor(
    private ngRedux: NgRedux<IAppState>,
    private devTool: DevToolsExtension,
    private rootEpic: RootEpic,
    private router: Router,
  ) {
    const middleware = [
      createEpicMiddleware(this.rootEpic.combineAll()),
      createLogger(),
    ];

    const reducer = compose(
      mergePersistedState()
    )(rootReducer);

    const storage = compose(
      filter('auth')
    )(adapter(window.localStorage));

    const enhancers = [
      persistState(storage, 'fyibn/store'),
    ];

    if (devTool.isEnabled()) {
      enhancers.push(devTool.enhancer());
    }

    this.ngRedux.configureStore(
      reducer,
      {} as IAppState,
      middleware,
      enhancers,
    );
  }
开发者ID:pusherman,项目名称:fyibn-ui,代码行数:34,代码来源:app.component.ts

示例2: constructor

  constructor(
    private ngRedux: NgRedux<IAppState>,
    private devTools: DevToolsExtension
  ) {

    const tools = devTools.isEnabled() ?
      [ ...enhancers, devTools.enhancer() ] : enhancers;

    ngRedux.configureStore(
      rootReducer,
      {},
      middleware,
      tools
    );
  }
开发者ID:christinakayastha,项目名称:parkabler,代码行数:15,代码来源:app.component.ts

示例3: constructor

  constructor(
    private ngRedux: NgRedux<IAppState>,
    private devTools: DevToolsExtension) {

    let enhancers = [];
    // TODO: replace implementation
    const __DEVMODE__ = true;
    const initialState = { game: { level: 1 }, router: null };

    // You probably only want to expose this tool in devMode.
    if (__DEVMODE__ && devTools.isEnabled()) {
      enhancers = [ ...enhancers, devTools.enhancer() ];
    }

    ngRedux.configureStore(rootReducer, initialState, [], enhancers);
  }
开发者ID:GrafRaf,项目名称:sudoku,代码行数:16,代码来源:app.module.ts

示例4: constructor

  constructor(private appRef: ApplicationRef,
              private af: AngularFire,
              private ngRedux: NgRedux<StoreState>,
              private devTools: DevToolsExtension) {
    AppModule.angularFire = af;
    let enhancers = [];
    if (devTools.isEnabled()) {
      enhancers = [ ...enhancers, devTools.enhancer() ];
    }
    const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
    const store: any = createStore(
      rootReducer,
      initialState,
      composeEnhancers(
        applyMiddleware(),
        //autoRehydrate()
      )
      );
    //persistStore(store);

    ngRedux.provideStore(store);
  }
开发者ID:matantsu,项目名称:GetPro,代码行数:22,代码来源:app.module.ts


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