The Wayback Machine - https://web.archive.org/web/20211017090823/https://github.com/topics/stale-while-revalidate
Skip to content
#

stale-while-revalidate

Here are 16 public repositories matching this topic...

swr
Daiz
Daiz commented Nov 27, 2019

The documentation for mutate talks about local mutation for faster feedback, but the documented way to use it only mutates after a promise has resolved - in other words, not immediately.

As a result, I've found myself writing code in this kind of pattern:

mutate(path, { ...data, patch }, false); // mutate immediately, don't revalidate
await patchData(patch); // await the 

The web app informs users about all the launches by SpaceX and its rockets. It queries SpaceX's GraphQL API for the data. API responses are dynamically cached within service-worker with stale-while-revalidate approach. It's a PWA: is installable and works offline. It's developed using TDD approach and is completely typed with TypeScript.

  • Updated Oct 16, 2020
  • TypeScript

Improve this page

Add a description, image, and links to the stale-while-revalidate topic page so that developers can more easily learn about it.

Curate this topic

Add this topic to your repo

To associate your repository with the stale-while-revalidate topic, visit your repo's landing page and select "manage topics."

Learn more