fetch working

This commit is contained in:
Toshit Chawda 2024-07-07 01:11:13 -07:00
commit 5355f49957
No known key found for this signature in database
GPG key ID: 91480ED99E2B3D9D
10 changed files with 904 additions and 0 deletions

18
src/snapshot.ts Normal file
View file

@ -0,0 +1,18 @@
// The user likely has overwritten all networking functions after importing bare-client
// It is our responsibility to make sure components of Bare-Client are using native networking functions
export const fetch = globalThis.fetch;
export const WebSocket = globalThis.WebSocket;
export const Request = globalThis.Request;
export const Response = globalThis.Response;
export const XMLHttpRequest = globalThis.XMLHttpRequest;
export const WebSocketFields = {
prototype: {
send: WebSocket.prototype.send,
},
CLOSED: WebSocket.CLOSED,
CLOSING: WebSocket.CLOSING,
CONNECTING: WebSocket.CONNECTING,
OPEN: WebSocket.OPEN,
};