Skip to content

Commit 18a96be

Browse files
committed
Fixed fetchAPI default binding issue for window
1 parent fca7a60 commit 18a96be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/infrastructure/RepositoryFactoryHttp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export class RepositoryFactoryHttp implements RepositoryFactory {
6969
*/
7070
constructor(url: string, configs?: RepositoryFactoryConfig) {
7171
this.url = url;
72-
this.fetchApi = configs?.fetchApi || (typeof window !== 'undefined' && window.fetch) || fetch;
72+
this.fetchApi = configs?.fetchApi || (typeof window !== 'undefined' && window.fetch.bind(window)) || fetch;
7373
this.networkType = configs?.networkType
7474
? observableOf(configs.networkType)
7575
: this.createNetworkRepository().getNetworkType().pipe(shareReplay(1));

0 commit comments

Comments
 (0)