Is there a way to establish a default value for entities when initializing state in ngrx entities?
apple.model.ts
export class Apple {
id: number;
color: string;
}
apple.reducer.ts
export interface AppleState extends EntityState<Apple> { }
export const appleAdapter: EntityAdapter<Apple> = createEntityAdapter<Apple>();
const applesInitialState: AppleState = appleAdapter.getInitialState();
export const initialState: State = {
apples: applesInitialState
};
export function reducer(state = initialState, action: AppleActions): State {
switch (action.type) {
// ...
}
}
For instance, if I want to set a default color like 'red'.