import { createSelector } from '@ngrx/store' ; import { pizzasAdapter , selectPizzasState , } from 'app/shared/states/pizzas/pizzas.reducer' ; export const { selectIds : selectPizzaIds , selectEntities : selectPizzaEntities , selectAll : selectAllPizzas , selectTotal : selectPizzaTotal , } = pizzasAdapter . getSelectors ( ) ; export const selectCurrentPizzaId = createSelector ( selectPizzasState , pizzaState => pizzaState . selected ) ; export const selectCurrentUser = createSelector ( selectPizzaEntities , selectCurrentPizzaId , ( pizzasEntities , pizzaId ) => pizzasEntities [ pizzaId ] ) ;