1
0
mirror of https://github.com/checktheroads/hyperglass synced 2024-05-11 05:55:08 +00:00

continue typescript & chakra v1 migrations [skip ci]

This commit is contained in:
checktheroads
2020-12-22 02:00:36 -07:00
parent 2b7039943b
commit d263fb9203
22 changed files with 547 additions and 17 deletions

View File

@@ -0,0 +1,11 @@
import { useQuery } from 'react-query';
import type { TASNDetails } from '~/types';
async function query(asn: string): Promise<TASNDetails> {
const res = await fetch(`https://api.bgpview.io/asn/${asn}`, { mode: 'cors' });
return await res.json();
}
export function useASNDetail(asn: string) {
return useQuery(asn, query);
}