silverwolf-x's picture
download
raw
577 Bytes
import { ClientRequestInterceptor } from 'next/dist/compiled/@mswjs/interceptors/ClientRequest'
import { handleFetch } from './fetch'
type Fetch = typeof fetch
export function interceptHttpGet(originalFetch: Fetch): () => void {
const clientRequestInterceptor = new ClientRequestInterceptor()
clientRequestInterceptor.on('request', async ({ request }) => {
const response = await handleFetch(originalFetch, request)
request.respondWith(response)
})
clientRequestInterceptor.apply()
// Cleanup.
return () => {
clientRequestInterceptor.dispose()
}
}

Xet Storage Details

Size:
577 Bytes
·
Xet hash:
f0705521af2ce160e8af9697907c9d3a3bb187043f121114e7caac6e1bf1808e

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.