fix: fetch hooks not working if debug defined later

This commit is contained in:
H01001000
2022-12-24 02:42:17 +08:00
parent b2f2d19b84
commit 46b39b9e95

View File

@@ -83,14 +83,14 @@ export function createRestManager (
fetching:
options.fetching ??
function (opts: RestSendRequestOptions) {
options.debug?.(
rest.debug?.(
`[REST - fetching] URL: ${opts.url} | ${JSON.stringify(opts)}`
)
},
fetched:
options.fetched ??
function (opts: RestSendRequestOptions, response: Response) {
options.debug?.(
rest.debug?.(
`[REST - fetched] URL: ${opts.url} | Status: ${
response.status
} ${JSON.stringify(opts)}`