import { createEntityAdapter , EntityAdapter } from '@ngrx/entity' ; import * as PizzasActions from 'app/shared/states/pizzas//pizzas.actions' ; import { IPizzaCommon , IPizzasTable , } from 'app/shared/states/pizzas/pizzas.interface' ; export const pizzasAdapter = createEntityAdapter < IPizzaCommon > ( ) ; export function pizzasInitState ( ) { return pizzasAdapter . getInitialState ( ) ; } export function pizzasReducer ( pizzasTbl = pizzasInitState ( ) , action ) { switch ( action . type ) { case PizzasActions . LOAD_PIZZAS_SUCCESS : { return { ... pizzasTbl , ... action . payload , } ; } default : return pizzasTbl ; } }