import { createSelector } from 'reselect' ; import { RootState } from '../store' ; const attachments = ( state ) => state . attachments ; const currentID = ( _ , { ID } ) => ID ; export const attachmentByID = createSelector ( [ attachments , currentID ] , ( attachments , currentID ) => attachments [ currentID ] ) ;