import { Selector } from 'reselect' ; import { ChartType } from '../../..' ; import { getOnElementClickSelector } from '../../../../common/event_handler_selectors' ; import { GlobalChartState , PointerStates } from '../../../../state/chart_state' ; import { createCustomCachedSelector } from '../../../../state/create_selector' ; import { getLastClickSelector } from '../../../../state/selectors/get_last_click' ; import { getSettingsSpecSelector } from '../../../../state/selectors/get_settings_specs' ; import { getPartitionSpec } from './partition_spec' ; import { getPickedShapesLayerValues } from './picked_shapes' ; internal export function createOnElementClickCaller ( ) { const prev = { click : null } ; let selector = null ; return ( state ) => { if ( selector === null && state . chartType === ChartType . Partition ) { selector = createCustomCachedSelector ( [ getPartitionSpec , getLastClickSelector , getSettingsSpecSelector , getPickedShapesLayerValues ] , getOnElementClickSelector ( prev ) ) ; } if ( selector ) { selector ( state ) ; } } ; }