Guest User

Untitled

a guest
Oct 23rd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. // src/app/store/combine.ts
  2. // Exported via src/app/store/index.ts
  3.  
  4. import * as fromFood from './food';
  5. import {createSelector} from '@ngrx/store';
  6. import {FoodEffects} from './food/effects/food.effects';
  7.  
  8. /**
  9. * Make a map of states
  10. */
  11. export interface State {
  12. food: fromFood.State
  13. }
  14.  
  15. /**
  16. * Make a map of reducers
  17. */
  18. export const reducers = {
  19. food: fromFood.reducer
  20. };
  21.  
  22. /**
  23. * Export selectors
  24. */
  25.  
  26. export const getFood = (state: State) => state.food;
  27. export const getFoods = createSelector(getFood, fromFood.getFoods);
  28.  
  29. /**
  30. * Export effects
  31. */
  32. export const rootEffects = [FoodEffects];
Add Comment
Please, Sign In to add comment