Skip to content

Commit 4cc5e99

Browse files
committed
part 11
1 parent 652e641 commit 4cc5e99

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/actions/archive.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { STORY_ARCHIVE } from '../constants/actionTypes';
2+
3+
const doArchiveStory = id => ({
4+
type: STORY_ARCHIVE,
5+
id,
6+
});
7+
8+
export {
9+
doArchiveStory,
10+
};

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ import ReactDOM from 'react-dom';
33
import App from './components/App';
44
import store from './store';
55
import { getReadableStories } from './selectors/story';
6-
import { STORY_ARCHIVE } from './constants/actionTypes';
6+
import { doArchiveStory } from './actions/archive';
77
import './index.css';
88
import registerServiceWorker from './registerServiceWorker';
99

1010
function render() {
1111
ReactDOM.render(
1212
<App
1313
stories={getReadableStories(store.getState())}
14-
onArchive={id => store.dispatch({ type: STORY_ARCHIVE, id })}
14+
onArchive={id => store.dispatch(doArchiveStory(id))}
1515
/>,
1616
document.getElementById('root')
1717
);

0 commit comments

Comments
 (0)