diff --git a/src/app/shared/state/books.reducer.ts b/src/app/shared/state/books.reducer.ts index 53fe775..fbd7925 100644 --- a/src/app/shared/state/books.reducer.ts +++ b/src/app/shared/state/books.reducer.ts @@ -1,4 +1,4 @@ -import { createReducer, on } from "@ngrx/store"; +import { createReducer, on, Action } from "@ngrx/store"; import { BookModel } from "src/app/shared/models/book.model"; import { BooksPageActions } from "src/app/books/actions"; @@ -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 f2ca2c4..5146601 100644 --- a/src/app/shared/state/index.ts +++ b/src/app/shared/state/index.ts @@ -1,8 +1,13 @@ import { ActionReducerMap, createSelector, MetaReducer } from "@ngrx/store"; +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[] = [];