Adding metrics events for EIP-1559 V2 flow (#13329)
parent
a5b114c4f9
commit
cc1861a34e
@ -0,0 +1,22 @@ |
||||
import { useCallback } from 'react'; |
||||
|
||||
import { useGasFeeContext } from '../contexts/gasFee'; |
||||
import { updateEventFragment } from '../store/actions'; |
||||
|
||||
export const useTransactionEventFragment = () => { |
||||
const { transaction } = useGasFeeContext(); |
||||
|
||||
const updateTransactionEventFragment = useCallback( |
||||
(params) => { |
||||
if (!transaction) { |
||||
return; |
||||
} |
||||
updateEventFragment(`transaction-added-${transaction.id}`, params); |
||||
}, |
||||
[transaction], |
||||
); |
||||
|
||||
return { |
||||
updateTransactionEventFragment, |
||||
}; |
||||
}; |
Loading…
Reference in new issue