From 09acdcc14c50ae14d16296fff502eda402e96971 Mon Sep 17 00:00:00 2001 From: Mike Ryan Date: Sat, 28 Mar 2020 19:55:34 -0500 Subject: [PATCH] 04-setting-up-the-store --- src/app/shared/state/books.reducer.ts | 4 ++++ src/app/shared/state/index.ts | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/app/shared/state/books.reducer.ts b/src/app/shared/state/books.reducer.ts index 426fbbb..fda8bdc 100644 --- a/src/app/shared/state/books.reducer.ts +++ b/src/app/shared/state/books.reducer.ts @@ -35,3 +35,7 @@ export const booksReducer = createReducer( }; }) ); + +export function reducer(state: State | undefined, action: Action) { + return booksReducer(state, action); +} diff --git a/src/app/shared/state/index.ts b/src/app/shared/state/index.ts index 78e2fee..3b68c8d 100644 --- a/src/app/shared/state/index.ts +++ b/src/app/shared/state/index.ts @@ -2,8 +2,12 @@ import { ActionReducerMap, createSelector, MetaReducer } from "@ngrx/store"; import * as fromAuth from "./auth.reducer"; import * as fromBooks from "./books.reducer"; -export interface State {} +export interface State { + books: fromBooks.State; +} -export const reducers: ActionReducerMap = {}; +export const reducers: ActionReducerMap = { + books: fromBooks.reducer +}; export const metaReducers: MetaReducer[] = [];