import { createSelector } from 'reselect' ; import { QueueItem , QueueMap , GroupId } from '../types' ; import { Map } from 'immutable' ; import { queueSelector } from './index' ; export const queueItemsIds = createSelector ( [ queueSelector ] , ( queue ) => queue . map ( ( item ) => item . hitId ) . toArray ( ) ) ; export const uniqueGroupIdsInQueueHistogram = createSelector ( [ queueSelector ] , queue => queue . reduce ( ( acc , cur ) => acc . update ( cur . groupId , ( count ) => ( count ? count + 1 : 1 ) ) , Map < GroupId , number > ( ) ) ) ;