當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。