angular-ngrx-data

How can I customize my reducers using @ngrx/data?

不想你离开。 提交于 2021-02-19 05:19:32
问题 I am learning to use @ngrx/data, it is true that with that library I advance a lot of code, but I am having problems when it comes to personalizing it. I already saw how to add fields to collections export const entityMetadata: EntityMetadataMap = { User: { additionalCollectionState: { testing: null } } }; and set the module here: export class UsersModule { constructor(private eds: EntityDefinitionService) { eds.registerMetadataMap(entityMetadata); } } All good up there, but ..., How can I

create a selector for a ngrx/data entity

被刻印的时光 ゝ 提交于 2020-04-07 03:17:12
问题 I have a state and I'd like to create selectors from ngrx/data entities. import { Action, ActionReducer, ActionReducerMap, createFeatureSelector, createSelector, MetaReducer } from '@ngrx/store'; import {environment} from '../../environments/environment'; import * as fromRouter from '@ngrx/router-store'; import * as fromDrawer from './drawer'; import {InjectionToken} from '@angular/core'; import {NavigationItem} from '../models/navigation-item'; export interface State { router: fromRouter