1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 18:41:38 +01:00
metamask-extension/ui/app/hooks/useMetricEvent.js

10 lines
343 B
JavaScript

import { useContext, useCallback } from 'react'
import { MetaMetricsContext } from '../contexts/metametrics'
export function useMetricEvent (config = {}, overrides = {}) {
const metricsEvent = useContext(MetaMetricsContext)
const trackEvent = useCallback(() => metricsEvent(config, overrides), [config, overrides])
return trackEvent
}