Skip to content

Instantly share code, notes, and snippets.

@alshdavid
Last active September 13, 2021 23:47
Show Gist options
  • Save alshdavid/16f59c9cf2c535e1f56bf7b9ea873d32 to your computer and use it in GitHub Desktop.
Save alshdavid/16f59c9cf2c535e1f56bf7b9ea873d32 to your computer and use it in GitHub Desktop.
export interface IHTTPClient {
request(requset: Request): Promise<Response>
}
export class HTTPClient implements IHTTPClient {
private _fetch: window['fetch']
constructor(
fetch: window['fetch']
) {
this._fetch = fetch
}
request(requset: Request): Promise<Response> {
return this._fetch(request)
}
}
export interface IHTTPClient {
fetch(requset: Request): Promise<Response>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment