Skip to content

Commit f6d436f

Browse files
committed
part 6
1 parent 5aafb21 commit f6d436f

File tree

4 files changed

+25
-3
lines changed

4 files changed

+25
-3
lines changed

src/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ import './index.css';
66
import registerServiceWorker from './registerServiceWorker';
77

88
ReactDOM.render(
9-
<App stories={store.getState()} />,
9+
<App
10+
stories={store.getState().storyState}
11+
onArchive={() => {}}
12+
/>,
1013
document.getElementById('root')
1114
);
1215
registerServiceWorker();

src/reducers/archive.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const INITIAL_STATE = [];
2+
3+
function archiveReducer(state = INITIAL_STATE, action) {
4+
switch(action.type) {
5+
default : return state;
6+
}
7+
}
8+
9+
export default archiveReducer;

src/reducers/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { combineReducers } from 'redux';
2+
import storyReducer from './story';
3+
import archiveReducer from './archive';
4+
5+
const rootReducer = combineReducers({
6+
storyState: storyReducer,
7+
archiveState: archiveReducer,
8+
});
9+
10+
export default rootReducer;

src/store/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { createStore } from 'redux';
2-
import storyReducer from '../reducers/story';
2+
import rootReducer from '../reducers';
33

44
const store = createStore(
5-
storyReducer
5+
rootReducer
66
);
77

88
export default store;

0 commit comments

Comments
 (0)