mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-27 21:00:13 +01:00
10 lines
343 B
JavaScript
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
|
|
}
|