1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-27 21:00:13 +01:00
metamask-extension/ui/app/hooks/useMetricEvent.js
2020-06-10 13:31:14 -05:00

10 lines
357 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, metricsEvent, overrides])
return trackEvent
}