mars-v2-frontend/src/hooks/useSwapRoute.ts

11 lines
302 B
TypeScript
Raw Normal View History

2023-07-26 06:23:30 +00:00
import useSWR from 'swr'
import getSwapRoute from 'api/swap/getSwapRoute'
export default function useSwapRoute(denomIn: string, denomOut: string) {
return useSWR(`swapRoute-${denomIn}-${denomOut}`, () => getSwapRoute(denomIn, denomOut), {
fallbackData: [],
revalidateOnFocus: false,
2023-07-26 06:23:30 +00:00
})
}