fix: apiでネイティブfetchを格納する際に無名関数でラップするように (#29)
* fix fetch * add comment * 表現を変更
This commit is contained in:
		
							parent
							
								
									f278390012
								
							
						
					
					
						commit
						b7fd9e8c55
					
				|  | @ -46,7 +46,9 @@ export class APIClient { | |||
| 	}) { | ||||
| 		this.origin = opts.origin; | ||||
| 		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']>( | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue