File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -2,13 +2,14 @@ import React from 'react';
22import ReactDOM from 'react-dom' ;
33import App from './components/App' ;
44import store from './store' ;
5+ import { getReadableStories } from './selectors/story' ;
56import { STORY_ARCHIVE } from './constants/actionTypes' ;
67import './index.css' ;
78import registerServiceWorker from './registerServiceWorker' ;
89
910ReactDOM . render (
1011 < App
11- stories = { store . getState ( ) . storyState }
12+ stories = { getReadableStories ( store . getState ( ) ) }
1213 onArchive = { id => store . dispatch ( { type : STORY_ARCHIVE , id } ) }
1314 /> ,
1415 document . getElementById ( 'root' )
Original file line number Diff line number Diff line change 1+ const isNotArchived = archivedIds => story =>
2+ archivedIds . indexOf ( story . objectID ) === - 1 ;
3+
4+ const getReadableStories = ( { storyState, archiveState } ) =>
5+ storyState . filter ( isNotArchived ( archiveState ) ) ;
6+
7+ export {
8+ getReadableStories ,
9+ } ;
You can’t perform that action at this time.
0 commit comments