The fetch var in SolidFetchBuilder is allowed to be undefined:
|
private fetch: undefined | ((input: RequestInfo, init?: RequestInit | undefined) => Promise<Response>); |
This is difficult to work with in typescript, since you need to include checks. However, authenticateToken(options); and authenticateInteractive(options) return a SessionInfo, which does not allow fetch to be undefined.
I was wondering whether
- the methods
buildFromClientCredentialsToken and buildInteractive cannot simply return the SessionInfo object and/or
- default to nodefetch when undefined
On a more general note: what's the added-value of the SolidFetchBuilder class to these methods?
The
fetchvar inSolidFetchBuilderis allowed to be undefined:Bashlib/src/authentication/CreateFetch.ts
Line 44 in d4c82f0
This is difficult to work with in typescript, since you need to include checks. However,
authenticateToken(options);andauthenticateInteractive(options)return aSessionInfo, which does not allowfetchto be undefined.I was wondering whether
buildFromClientCredentialsTokenandbuildInteractivecannot simply return theSessionInfoobject and/orOn a more general note: what's the added-value of the
SolidFetchBuilderclass to these methods?