You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
377 B
13 lines
377 B
import { TWebMetadata } from '@/types' |
|
import { useEffect, useState } from 'react' |
|
import webService from '@/services/web.service' |
|
|
|
export function useFetchWebMetadata(url: string) { |
|
const [metadata, setMetadata] = useState<TWebMetadata>({}) |
|
|
|
useEffect(() => { |
|
webService.fetchWebMetadata(url).then((metadata) => setMetadata(metadata)) |
|
}, [url]) |
|
|
|
return metadata |
|
}
|
|
|