The TypeScript types for this library (https://github.com/jonbern/fetch-retry/blob/master/index.d.ts) indicate that there is a default export.
|
export default function fetchBuilder<F extends FetchLibrary>( |
|
fetch: F, |
|
defaults?: RequestInitRetryParams<F>, |
|
): (input: Parameters<F>[0], init?: RequestInitWithRetry<F>) => ReturnType<F>; |
The README says that proper usage of this library is like
const originalFetch = require('isomorphic-fetch');
const fetch = require('fetch-retry')(originalFetch);
This code is correct and works fine. However, the TypeScript types suggest that the following is necessary, even though the it does not work and there is no default value.
const originalFetch = require('isomorphic-fetch');
const fetchRetry = require('fetch-retry');
const fetch = fetchRetry.default(originalFetch);
The TypeScript types for this library (https://github.com/jonbern/fetch-retry/blob/master/index.d.ts) indicate that there is a default export.
fetch-retry/index.d.ts
Lines 25 to 28 in 8684ef4
The README says that proper usage of this library is like
This code is correct and works fine. However, the TypeScript types suggest that the following is necessary, even though the it does not work and there is no
defaultvalue.