synapsecns/sanguine

View on GitHub
packages/synapse-interface/utils/hooks/useSwr.tsx

Summary

Maintainability
A
0 mins
Test Coverage
import useSWR from 'swr'

const jsonFetcher = async (url: string) => {
  return fetch(url).then((res) => res.json())
}

export const useSwr = (endpoint: string) => {
  return useSWR(endpoint, jsonFetcher)
}