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

TypeScript core.compose函数代码示例

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

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
TypeScript compose.compose函数代码示例发布时间:2022-05-28
下一篇:
TypeScript core.DynamicFormsCoreModule类代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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