add default fetcher fallback for ModuleApi

This commit is contained in:
dswbx
2025-02-13 11:24:35 +01:00
parent 4dde67ca21
commit cc938db4b8

View File

@@ -26,7 +26,11 @@ export abstract class ModuleApi<Options extends BaseModuleApiOptions = BaseModul
constructor( constructor(
protected readonly _options: Partial<Options> = {}, protected readonly _options: Partial<Options> = {},
protected fetcher?: typeof fetch protected fetcher?: typeof fetch
) {} ) {
if (!fetcher) {
this.fetcher = fetch;
}
}
protected getDefaultOptions(): Partial<Options> { protected getDefaultOptions(): Partial<Options> {
return {}; return {};