(config: {
baseUrl?: string
token?: string
getToken?: (() => string) | null
on401?: (() => void) | null
})
| 11 | let _on401: (() => void) | undefined |
| 12 | |
| 13 | export function configureHttpClient(config: { |
| 14 | baseUrl?: string |
| 15 | token?: string |
| 16 | getToken?: (() => string) | null |
| 17 | on401?: (() => void) | null |
| 18 | }): void { |
| 19 | if (config.baseUrl !== undefined) _baseUrl = config.baseUrl |
| 20 | if (config.token !== undefined) _token = config.token |
| 21 | if (config.getToken !== undefined) _getToken = config.getToken ?? undefined |
| 22 | if (config.on401 !== undefined) _on401 = config.on401 ?? undefined |
| 23 | } |
| 24 | |
| 25 | function resolveToken(): string { |
| 26 | return _getToken ? _getToken() : _token |
no outgoing calls
no test coverage detected