mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-30 16:18:07 +01:00
10 lines
357 B
JavaScript
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
|
|
}
|