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


TypeScript core.compose函数代码示例

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


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

示例1: compose

import {appDb} from "../store/reducers/appdb.reducer";
import {msDatabase} from "../store/reducers/msdb.reducer";
import {storeFreeze} from "ngrx-store-freeze";
import {ActionReducer, combineReducers} from "@ngrx/store";
import {ApplicationState} from "./application.state";
import {compose} from "@ngrx/core";
import {MainAppShowStateEnum} from "../app/app-component";
import {LocationMarkModel} from "../models/LocationMarkModel";
import {StationModel} from "../models/StationModel";
import {FasterqLineModel} from "../models/fasterq-line-model";
import {FasterqQueueModel} from "../models/fasterq-queue-model";
import {FasterqAnalyticsModel} from "../models/fasterq-analytics";
import {LiveLogModel} from "../models/live-log-model";

const reducers = {msDatabase, appDb};
export const developmentReducer: ActionReducer<ApplicationState> = compose(storeFreeze, combineReducers)(reducers);
export const productionReducer: ActionReducer<ApplicationState> = combineReducers(reducers);

export enum StoryBoardListViewModeEnum {
    ListMode,
    StoryMode
}

export interface IMsDatabase {
    thread: { [key: number]: any };
    sdk: ISDK;
}

export interface IStation {
    id: number;
    localAddress: any;
开发者ID:born2net,项目名称:signagestudio_web-lite,代码行数:31,代码来源:store.data.ts

示例2: combineReducers

 */
const reducers = {
    operations: fromOperations.reducer,
    currencies: fromCurrencies.reducer
}

/**
 * Using combineReducers to create the Meta Reducer and export it from the module.
 * The exported Meta Reducer will be used as an argument
 * in provideStore() in the application's root module.
 */
const combinedReducer: ActionReducer<State> = combineReducers(reducers);

export function reducer(state: any, action: any) {
    return combinedReducer(state, action);
}

export function getOperations(state$: Observable<State>) {
   return state$.select(state => state.operations);
}

export function getCurrencies(state$: Observable<State>) {
  return state$.select(state => state.currencies);
}
export const getEntities = compose(fromOperations.getEntities, getOperations);
export const getCurrencyEntities = compose(fromCurrencies.getCurrenciesEntities , getCurrencies);
export const getSelectedCurrency = compose(fromCurrencies.getSelectedCurrency , getCurrencies);
export const getCurrencyRates = compose(fromCurrencies.getRates , getCurrencies);


开发者ID:mtranggit,项目名称:ng-redux-fin-app,代码行数:28,代码来源:index.ts

示例3: compose

import { combineReducers } from '@ngrx/store';
import { compose } from '@ngrx/core';
import { emailStepReducer } from 'app/store/reducers/email-step.reducer';
import { professionalStepReducer } from 'app/store/reducers/professional-step.reducer';

export default compose(combineReducers)({
    emailStep: emailStepReducer,
    professionalStep: professionalStepReducer
});
开发者ID:hugoparis19,项目名称:funnel,代码行数:9,代码来源:tunnel.state.ts

示例4: compose

	apiResponse: fromApiResponse.reducer,
	apiTrendsResponse: fromApiTrendsResponse.reducer,
	pagination: fromPagination.reducer,
	apiUserResponse: fromApiUserResponse.reducer,
	suggestService: fromSuggest.reducer,
	suggestResponse: fromSuggestResponse.reducer,
	mediaWallQuery: fromMediaWallQuery.reducer,
	mediaWallResponse: fromMediaWallResponse.reducer,
	mediaWallSearch: fromMediaWallSearch.reducer,
	mediaWallCustom: fromMediaWallCustom.reducer,
	mediaWallPagination: fromMediaWallPagination.reducer,
	mediaWallDesign: fromMediaWallDesign.reducer,
	mediaWallDirectUrl: fromMediaWallDirectUrl.reducer
};

const developmentReducer: ActionReducer<State> = compose(storeFreeze, combineReducers)(reducers);
const productionReducer: ActionReducer<State> = combineReducers(reducers);

export function reducer(state: any, action: any) {
	if (environment.production) {
		return productionReducer(state, action);
	}
	else {
		return developmentReducer(state, action);
	}
}

/**
 * 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 `repository` state.
开发者ID:eddygta17,项目名称:loklak_search,代码行数:31,代码来源:index.ts

示例5: 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


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