import { useFetcher } from '../../hooks/use_fetcher' ; const INITIAL_DATA = { transactionTypes : [ ] } ; export function useServiceTransactionTypesFetcher ( { serviceName , start , end , } ) { const { data = INITIAL_DATA } = useFetcher ( ( callApmApi ) => { if ( serviceName && start && end ) { return callApmApi ( { endpoint : 'GET /internal/apm/services/{serviceName}/transaction_types' , params : { path : { serviceName } , query : { start , end } , } , } ) ; } } , [ serviceName , start , end ] ) ; return data . transactionTypes ; }