import { RootState } from '../types';

import { connect } from 'react-redux';
import HitTable, { Props } from '../components/HitTable/HitTable';

// import { batchFetchTOpticon, selectRequesterId } from '../utils/turkopticon';

const mapState = (state: RootState): Props => ({
  hits: state.hits
});

export default connect(mapState)(HitTable);

import { RootState, Hit } from '../types';

import { connect, Dispatch } from 'react-redux';
import * as actions from '../actions/turkopticon';
import HitTable, { Props, Handlers } from '../components/HitTable/HitTable';

import { batchFetchTOpticon, selectRequesterIds } from '../utils/turkopticon';

const mapState = (state: RootState): Props => ({
  hits: state.hits
});

const mapDispatch = (dispatch: Dispatch<actions.TOpticonAction>): Handlers => ({
  onRefresh: async (hits: Hit[]) => {
    try {
      const freshTOpticons = await batchFetchTOpticon(selectRequesterIds(hits));
      dispatch(actions.fetchTOpticonSuccess(freshTOpticons));
    } catch (e) {
      dispatch(actions.fetchTOpticonFailure());
    }
  }
});

export default connect(mapState, mapDispatch)(HitTable);

--- 
+++ 
@@ -1,24 +1,12 @@
-import { RootState, Hit } from '../types';
+import { RootState } from '../types';
 
-import { connect, Dispatch } from 'react-redux';
-import * as actions from '../actions/turkopticon';
-import HitTable, { Props, Handlers } from '../components/HitTable/HitTable';
+import { connect } from 'react-redux';
+import HitTable, { Props } from '../components/HitTable/HitTable';
 
-import { batchFetchTOpticon, selectRequesterIds } from '../utils/turkopticon';
+// import { batchFetchTOpticon, selectRequesterId } from '../utils/turkopticon';
 
 const mapState = (state: RootState): Props => ({
   hits: state.hits
 });
 
-const mapDispatch = (dispatch: Dispatch<actions.TOpticonAction>): Handlers => ({
-  onRefresh: async (hits: Hit[]) => {
-    try {
-      const freshTOpticons = await batchFetchTOpticon(selectRequesterIds(hits));
-      dispatch(actions.fetchTOpticonSuccess(freshTOpticons));
-    } catch (e) {
-      dispatch(actions.fetchTOpticonFailure());
-    }
-  }
-});
-
-export default connect(mapState, mapDispatch)(HitTable);
+export default connect(mapState)(HitTable);
Refactor for use as callbacks to be passed to .map and .filter
