/** * External dependencies */ import { values } from 'lodash'; import { createIndexedSelector } from '@nab/utils'; import type { ConversionAction, GoalId } from '@nab/types'; /** * Internal dependencies. */ import type { State } from '../types'; export const getConversionActions = createIndexedSelector( ( state: State, goalId: GoalId ): ReadonlyArray< ConversionAction > => values( state.experiment.conversionActions[ goalId ] ), ( state: State, goalId: GoalId ) => ( { key: goalId, dependants: [ state.experiment.conversionActions[ goalId ] ], } ) );