• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript ngrx-store-logger.storeLogger函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中ngrx-store-logger.storeLogger函数的典型用法代码示例。如果您正苦于以下问题:TypeScript storeLogger函数的具体用法?TypeScript storeLogger怎么用?TypeScript storeLogger使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: rootReducer

export function rootReducer (state: AppBackgroundState, action: Action) {
  if (action.type === 'SET_NEW_STATE') {
      state = Object.assign({}, state, action.payload);
  }
  if (!environment.production) {
    return compose(storeLogger(), combineReducers)(appBackgroundState)(state, action);
  } else {
    return compose(combineReducers)(appBackgroundState)(state, action);
  }
}
开发者ID:Le0Michine,项目名称:Messanger,代码行数:10,代码来源:app-background.store.ts


示例2: main

export function main() {
  return bootstrap(AsyncApp, [
      HTTP_PROVIDERS,
      provideStore(
        storeLogger()(combineReducers({selectedReddit, postsByReddit}))
      ),
      runEffects(RedditEffects),
      Reddit
  ])
  .catch(err => console.error(err));
}
开发者ID:ManuCutillas,项目名称:ngrx-examples,代码行数:11,代码来源:bootstrap.ts


示例3: compose

  books: fromBooks.BooksState;
  cubes: fromCubes.CubesState;
  collection: fromCollection.CollectionState;
  cube_collection: fromCubesCollection.CollectionState;
  tree: fromTree.TreesState
}


/**
 * Because metareducers take a reducer function and return a new reducer,
 * we can use our compose helper to chain them together. Here we are
 * using combineReducers to make our top level reducer, and then
 * wrapping that in storeLogger. Remember that compose applies
 * the result from right to left.
 */
export default compose(storeLogger(), combineReducers)({
  router: routerReducer,
  search: searchReducer,
  cubes_search: cubes_searchReducer,
  books: booksReducer,
  cubes: cubesReducer,
  collection: collectionReducer,
  cube_collection: cubes_collectionReducer,
  tree: tree_Reducer
});


/**
 * A selector function is a map function factory. We pass it parameters and it
 * returns a function that maps from the larger state tree into a smaller
 * piece of state. This selector simply selects the `books` state.
开发者ID:mlukasch,项目名称:indigo,代码行数:31,代码来源:index.ts


示例4: stateSetter

import { storeFreeze } from 'ngrx-store-freeze';
import { storeLogger } from 'ngrx-store-logger';
import { reducers } from './root';

export { reducers, AppState } from './root';

declare const ENV: string;

// Generate a reducer to set the root state in dev mode for HMR
function stateSetter(reducer: ActionReducer<any>): ActionReducer<any> {
  return function(state, action) {
    if (action.type === 'SET_ROOT_STATE') {
      return action.payload;
    }
    return reducer(state, action);
  };
}

const DEV_REDUCERS = [stateSetter, storeFreeze, storeLogger()];

const developmentReducer = compose(...DEV_REDUCERS, combineReducers)(reducers);
const productionReducer = compose(combineReducers)(reducers);

export function rootReducer(state: any, action: any) {
  if (ENV !== 'development') {
    return productionReducer(state, action);
  } else {
    return developmentReducer(state, action);
  }
}
开发者ID:greg9504,项目名称:angular-electron-dream-starter,代码行数:30,代码来源:index.ts


示例5: compose

import { compose } from '@ngrx/core/compose';
import { storeLogger } from 'ngrx-store-logger';
import { combineReducers } from '@ngrx/store';
import { itemReducer } from './item/item.reducer';

export const appReducer = compose(storeLogger(), combineReducers)({
  item: itemReducer,
});
开发者ID:penmark,项目名称:mediat-frontend,代码行数:8,代码来源:app.reducer.ts


示例6: compose

import { storeLogger } from 'ngrx-store-logger';
import { localStorageSync } from 'ngrx-store-localstorage';

import { IState as ICounterState, reducer as counterReducer } from './counter';
import { IState as IUserState, reducer as userReducer } from './user';
import { IState as IConfigState, reducer as configReducer } from './config';

// application state interface
export interface IState {
  router: RouterState;
  config: IConfigState;
  counter: ICounterState;
  user: IUserState;
}

// app level reducers
export const reducers = {
  router: routerReducer,
  config: configReducer,
  counter: counterReducer,
  user: userReducer
};

// root reducer
export const reducer: ActionReducer<IState> = compose(
  storeLogger(),
  storeFreeze,
  localStorageSync(keys(reducers), true),
  combineReducers
)(reducers);
开发者ID:lunches-platform,项目名称:fe,代码行数:30,代码来源:app.reducer.ts


示例7: compose

  auth: AuthState;
  schedules: ScheduleState;
  speakers: SpeakerState;
  map: MapState;
}

/**
 * Because metareducers take a reducer function and return a new reducer,
 * we can use our compose helper to chain them together. Here we are
 * using combineReducers to make our top level reducer, and then
 * wrapping that in storeLogger. Remember that compose applies
 * the result from right to left.
 */
const reducers = {
  map: mapReducer,
  speakers: speakerReducer,
  schedules: scheduleReducer,
  auth: authReducer
};

const developmentReducer = compose(storeFreeze, storeLogger(), combineReducers)(reducers);
const productionReducer = combineReducers(reducers);

export function reducer(state: any, action: any) {
  if (process.env.NODE_ENV === 'production') {
    return productionReducer(state, action);
  } else {
    return developmentReducer(state, action);
  }
}
开发者ID:ddellamico,项目名称:ionic-conference-app,代码行数:30,代码来源:index.ts


示例8: logger

export function logger(_reducer: ActionReducer<any>): any {
  return storeLogger()(_reducer);
}
开发者ID:garlictech,项目名称:generator-garlic-webapp,代码行数:3,代码来源:index.ts


示例9: compose

// Re export symbol for commodity
export { Store, Action, State } from '@ngrx/store';


import { REDUCERS as PROJECTS_REDUCER } from './projects.reducer';

var REDUCERS = Object.assign({}, PROJECTS_REDUCER);

export var PROVIDERS: Array<any> = [];

const initialState = {

}

import { StoreModule, combineReducers } from '@ngrx/store';
import { compose } from '@ngrx/core';
import { storeLogger } from 'ngrx-store-logger';

export const MODULE =
    StoreModule.provideStore(
        compose(
            storeLogger({ collapsed: true }),
            combineReducers
        )(REDUCERS), 
        initialState);
开发者ID:ClementVidal,项目名称:infra.starter.themba,代码行数:25,代码来源:index.ts


示例10: logger

export function logger(reducer: ActionReducer<State>): any {
  return storeLogger({
    collapsed: true
  })(reducer);
}
开发者ID:atSistemas,项目名称:angular-base,代码行数:5,代码来源:index.ts



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap