mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-23 10:30:04 +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
|
|
}
|