-
-
Save Developer1Dev/849a7bf1ddd18eef7da2d1e9007d3750 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
request(): Observable<any> { | |
return new Observable(observer => { | |
fetch(`${baseUrl}${this.url}`,{ | |
method: this.method as any, | |
headers: this.headers, | |
body: this.body | |
}).then((r: any) => { | |
return r.json() | |
}).then((data: any) => { | |
observer.next(data); | |
observer.complete(); | |
}).catch((e: any) => { | |
observer.error(e);}) | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment