import { useMemo } from 'react' ; import { callApi } from '../../../../services/rest/callApi' ; import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plugin_context' ; import { FetchOptions } from '../../../../../common/fetch_options' ; export function useCallApi ( ) { const { core } = useApmPluginContext ( ) ; return useMemo ( ( ) => { return < T = void > ( options ) => callApi < T > ( core , options ) ; } , [ core ] ) ; }