Skip to content

Commit

Permalink
added initial state
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenGrider committed Jan 24, 2016
1 parent 4623107 commit 3867785
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion blog/src/reducers/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { combineReducers } from 'redux';
import PostsReducer from './reducer_posts';

const rootReducer = combineReducers({
state: (state = {}) => state
posts: PostsReducer
});

export default rootReducer;
12 changes: 12 additions & 0 deletions blog/src/reducers/reducer_posts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { FETCH_POSTS } from '../actions/index';

const INITIAL_STATE = { all: [], post: null };

export default function(state = INITIAL_STATE, action) {
switch(action.type) {
case FETCH_POSTS:

default:
return state;
}
}

0 comments on commit 3867785

Please sign in to comment.