Workspaces refactor #86
1 changed files with 3 additions and 1 deletions
|
@ -46,7 +46,9 @@ export class APIClient {
|
||||||
}) {
|
}) {
|
||||||
this.origin = opts.origin;
|
this.origin = opts.origin;
|
||||||
this.credential = opts.credential;
|
this.credential = opts.credential;
|
||||||
this.fetch = opts.fetch || fetch;
|
// ネイティブ関数をそのまま変数に代入して使おうとするとChromiumではIllegal invocationエラーが発生するため、
|
||||||
|
// 環境で実装されているfetchを使う場合は無名関数でラップして使用する
|
||||||
|
this.fetch = opts.fetch || ((...args) => fetch(...args));
|
||||||
}
|
}
|
||||||
|
|
||||||
public request<E extends keyof Endpoints, P extends Endpoints[E]['req']>(
|
public request<E extends keyof Endpoints, P extends Endpoints[E]['req']>(
|
||||||
|
|
Loading…
Reference in a new issue