@ngrx/store#combineReducers TypeScript Examples
The following examples show how to use
@ngrx/store#combineReducers.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.ts From digital-bank-ui with Mozilla Public License 2.0 | 6 votes |
export function reducers(state: CustomerState | undefined, action: Action) {
return combineReducers({
customers: createResourceReducer(customerFeatureKey, fromCustomers.reducer),
customerForm: createFormReducer(customerFeatureKey),
tasks: createResourceReducer('Task', fromTasks.reducer),
taskForm: createFormReducer('Task'),
depositSearch: createSearchReducer('Deposit'),
customerTasks: fromCustomerTasks.reducer,
customerCatalog: fromCatalogs.reducer,
customerCommands: fromCommands.reducer,
customerIdentificationCards: createResourceReducer('Customer Identity Card', fromCustomerIdentificationCards.reducer, 'number'),
customerIdentificationCardForm: createFormReducer('Customer Identity Card'),
customerIdentificationCardScans: createResourceReducer('Customer Identity Card Scan', fromScans.reducer),
customerIdentificationCardScanForm: createFormReducer('Customer Identity Card Scan'),
customerPayrollDistribution: fromPayrollDistribution.reducer,
})(state, action);
}
Example #2
Source File: index.ts From digital-bank-ui with Mozilla Public License 2.0 | 6 votes |
export function reducers(state: OfficeState | undefined, action: Action) {
return combineReducers({
offices: createResourceReducer(officeFeatureKey),
officeForm: createFormReducer(officeFeatureKey),
tellers: createResourceReducer(officeTellerFeatureKey, fromTellers.reducer, 'code'),
tellerForm: createFormReducer(officeTellerFeatureKey),
denominations: fromDenominations.reducer,
})(state, action);
}
Example #3
Source File: index.ts From digital-bank-ui with Mozilla Public License 2.0 | 6 votes |
export function createReducer(asyncReducers = {}): ActionReducer<any> {
const actionReducer = compose(
localStorageSync({
keys: [],
rehydrate: true,
}),
combineReducers,
)(Object.assign(reducers, asyncReducers));
return function(state: any, action: any) {
// Reset state
if (action.type === authenticationActions.LOGOUT_SUCCESS) {
return actionReducer(undefined, action);
}
return actionReducer(state, action);
};
}
Example #4
Source File: index.ts From router with MIT License | 5 votes |
export function reducers(state: AuthState | undefined, action: Action) {
return combineReducers({
[fromAuth.statusFeatureKey]: fromAuth.reducer,
[fromLoginPage.loginPageFeatureKey]: fromLoginPage.reducer,
})(state, action);
}
Example #5
Source File: index.ts From router with MIT License | 5 votes |
/** Provide reducer in AoT-compilation happy way */
export function reducers(state: BooksState | undefined, action: Action) {
return combineReducers({
[fromSearch.searchFeatureKey]: fromSearch.reducer,
[fromBooks.booksFeatureKey]: fromBooks.reducer,
[fromCollection.collectionFeatureKey]: fromCollection.reducer,
})(state, action);
}
Example #6
Source File: index.ts From dating-client with MIT License | 5 votes |
reducer = combineReducers({ [fromMembers.membersEntityFeatureKey]: fromMembers.reducer })
Example #7
Source File: index.ts From dating-client with MIT License | 5 votes |
reducer = combineReducers({ [userProfileSettingsFeatureKey]: settingsReducer, [userPhotosFeatureKey]: photosReducer, })
Example #8
Source File: index.ts From digital-bank-ui with Mozilla Public License 2.0 | 5 votes |
export function reducers(state: CustomerDepositState | undefined, action: Action) {
return combineReducers({
deposits: createResourceReducer('Deposit', undefined, 'accountIdentifier'),
})(state, action);
}
Example #9
Source File: index.ts From digital-bank-ui with Mozilla Public License 2.0 | 5 votes |
export function reducers(state: DepositProductsState | undefined, action: Action) {
return combineReducers({
depositProducts: createResourceReducer(depositProductsFeatureKey, fromProducts.reducer),
depositProductForm: createFormReducer(depositProductsFeatureKey),
depositProductSearch: createSearchReducer(depositProductsFeatureKey),
depositProductDividends: fromDividends.reducer,
})(state, action);
}
Example #10
Source File: index.ts From digital-bank-ui with Mozilla Public License 2.0 | 5 votes |
export function reducers(state: RoleState | undefined, action: Action) {
return combineReducers({
roles: createResourceReducer(roleFeatureKey),
roleForm: createFormReducer(roleFeatureKey),
})(state, action);
}
Example #11
Source File: index.ts From digital-bank-ui with Mozilla Public License 2.0 | 5 votes |
export function reducers(state: UserState | undefined, action: Action) {
return combineReducers({
users: createResourceReducer(userFeatureKey),
userForm: createFormReducer(userFeatureKey),
})(state, action);
}