本文整理汇总了TypeScript中@ngrx/core/compose.compose函数的典型用法代码示例。如果您正苦于以下问题:TypeScript compose函数的具体用法?TypeScript compose怎么用?TypeScript compose使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了compose函数的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: 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
示例3: isLoading
public static isLoading(): (selector: Observable<AppState>) => Observable<boolean> {
return compose(this._isLoading(), this.getAuthState());
}
开发者ID:ddellamico,项目名称:ionic-conference-app,代码行数:3,代码来源:auth.selector.ts
示例4: getErrorMessage
/**
* Every reducer module exports selector functions, however child reducers
* have no knowledge of the overall state tree. To make them useable, we
* need to make new selectors that wrap them.
*
* Once again our compose function comes in handy. From right to left, we
* first select the auths state then we pass the state to the auth
* reducer's _getAuthItems selector, finally returning an observable
* of search results.
*/
public static getErrorMessage(): (selector: Observable<AppState>) => Observable<string> {
return compose(this._getErrorMessage(), this.getAuthState());
}
开发者ID:ddellamico,项目名称:ionic-conference-app,代码行数:13,代码来源:auth.selector.ts
示例5: isCubeInCollection
export function isCubeInCollection(id: string) {
return compose(fromCubesCollection.isCubeInCollection(id), getCubesCollectionState());
}
开发者ID:mlukasch,项目名称:indigo,代码行数:3,代码来源:index.ts
示例6: getCollectionCubeIds
export function getCollectionCubeIds() {
return compose(fromCubesCollection.getCubeIds(), getCollectionState());
}
开发者ID:mlukasch,项目名称:indigo,代码行数:3,代码来源:index.ts
示例7: getCubesCollectionLoading
export function getCubesCollectionLoading() {
return compose(fromCubesCollection.getLoading(), getCubesCollectionState());
}
开发者ID:mlukasch,项目名称:indigo,代码行数:3,代码来源:index.ts
示例8: getCubesSearchQuery
export function getCubesSearchQuery() {
return compose(fromCubesSearch.getQuery(), getCubesSearchState());
}
开发者ID:mlukasch,项目名称:indigo,代码行数:3,代码来源:index.ts
示例9: compose
import { compose } from '@ngrx/core/compose';
import * as fromMissingWord from './missing-word-exercise/missing-word-exercise.reducer';
import { getSelectedExerciseState } from './exercises.reducer';
export { ExercisesRoutes } from './exercises.routes';
export { ExercisesComponent } from './exercises.component';
export { exercisesReducer } from './exercises.reducer';
export const getSelectedExerciseSentences = compose(fromMissingWord.getMissingWordsSentences, getSelectedExerciseState);
export const getSelectedExerciseMissingWordsAnswers = compose(fromMissingWord.getMissingWordsAnswers, getSelectedExerciseState);
export const getSelectedExerciseSentencesNums = compose(fromMissingWord.getMissingWordsNums, getSelectedExerciseState);
export const getSelectedExerciseMissingWords = compose(fromMissingWord.getMissingWords, getSelectedExerciseState);
export const isSelectedExerciseValidated = compose(fromMissingWord.isValidated, getSelectedExerciseState);
开发者ID:pocmanu,项目名称:angular2-seed-advanced,代码行数:14,代码来源:index.ts
示例10: compose
import { compose } from "@ngrx/core/compose";
// reducers
import { videos, EchoesVideos } from './youtube-videos';
import { player, YoutubePlayerState, PlayerActions} from './youtube-player';
import { nowPlaylist, YoutubeMediaPlaylist, NowPlaylistActions} from './now-playlist';
import { user, UserProfile } from './user-manager';
import { search, PlayerSearch} from './player-search';
import { localStorageSync } from './ngrx-store-localstorage';
/**
* As mentioned, we treat each reducer like a table in a database. This means
* our top level state interface is just a map of keys to inner state types.
*/
export interface EchoesState {
videos: EchoesVideos;
player: YoutubePlayerState;
nowPlaylist: YoutubeMediaPlaylist;
user: UserProfile;
search: PlayerSearch;
}
export const actions = [
NowPlaylistActions,
PlayerActions
];
export default compose(
localStorageSync(['videos', 'player', 'nowPlaylist', 'search'], true),
combineReducers
)({ videos, player, nowPlaylist, user, search });
开发者ID:DavyDuDu,项目名称:echoes-ng2,代码行数:30,代码来源:index.ts
注:本文中的@ngrx/core/compose.compose函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论