sswr icon indicating copy to clipboard operation
sswr copied to clipboard

🔥 Svelte stale while revalidate (SWR) data fetching strategy

Results 18 sswr issues
Sort by recently updated
recently updated
newest added

The current SSR example from the readme does not work. I have submitted a working SSR example in https://github.com/ConsoleTVs/sswr/pull/32 and I think that is the only way to have working...

If I clone the default Svelte template via `npx degit sveltejs/template my-svelte-project`, then `yarn add sswr`, and copy&paste the dependent fetching example from the README into "App.svelte"... ```svelte import {...

bug

Is there a way to persist data to `LocalStorage` / `IndexedDB` to "start from there" for example at PC reboot?

Solution: Migrate the subscription from onMount to beforeUpdate. Theory: onMount is too early in the lifecycle for reactivity

Using the below code it makes `data === undefined`. Why? **REPL**: https://svelte.dev/repl/40782b4783244075b8c58cffbcf9acd4?version=3.42.1. ```html import { useSWR } from "sswr"; let pagination = defaultPagination; $: ({ data, error } = useSWR(`players`,...

bug

This was my `fetcher` function: ```js async function readUser() { return localStorage.user ?? null; } ``` If I'd go to the console and run `localStorage.removeItem('user')`, revalidation of any kind (whether...

bug

Now I'm using `svelte-query` but I'm not happy with it: it has not-so-convenient APIs (@benbender is working on it, but the maintainer is not so active, so I doubt it...

### PROLOGUE I'm sorry if I'm always mentioning svelte-query these days. I'll stop shortly (I'm starting a new project and I wanna use your gorgeous `sswr`). I hope to be...

I use `sswr` in a SvelteKit application (`"@sveltejs/kit": "^1.0.0-next.442"`). In dev, everything works fine. However, when I run `npm run build` and `npm run preview` and load a page that...