chore: logging for swr fetch
parent
257044e66d
commit
959a613ea3
|
@ -1,4 +1,6 @@
|
|||
import { writable } from "svelte/store";
|
||||
import { debug } from "debug";
|
||||
const dbg = debug("kestrel:swrshim");
|
||||
|
||||
// stale shim until https://github.com/ConsoleTVs/sswr/issues/24 is resolved
|
||||
export type SWRKey = string;
|
||||
|
@ -10,6 +12,7 @@ export function useSWR<D = unknown, E = Error>(
|
|||
const error = writable<E | undefined>();
|
||||
|
||||
async function doFetch() {
|
||||
dbg("Fetching: %s", key);
|
||||
try {
|
||||
const response = await fetch(key, options);
|
||||
if (response.ok) {
|
||||
|
|
Loading…
Reference in New Issue