forked from StephenGrider/ReduxCasts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b0dee24
commit 386754e
Showing
2 changed files
with
13 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
import { combineReducers } from 'redux'; | ||
import BooksReducer from './reducer_books'; | ||
import ActiveBook from './reducer_active_book'; | ||
|
||
const rootReducer = combineReducers({ | ||
books: BooksReducer | ||
books: BooksReducer, | ||
activeBook: ActiveBook | ||
}); | ||
|
||
export default rootReducer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// State argument is not application state, only the state | ||
// this reducer is responsible for | ||
export default function(state = null, action) { | ||
switch(action.type) { | ||
case 'BOOK_SELECTED': | ||
return action.payload; | ||
} | ||
|
||
return state; | ||
} |