clockelliptic / clockelliptic/idb-sideloader
implement optional stale-while-revalidate behavior
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
To Do: implement optional stale-while-revalidate behavior
Why:
- support & maximize progressive behavior
- allow stale or placeholder data to be shown optimistically while new data is loaded in the background, ideally in a non-blocking fashion
Acceptance Criteria:
- `IDBSideloader` constructor accepts an optional prop to enable stale-while-revalidate (swr) behavior
- swr behavior attempt to load cached data, and then re-fetches data in the background
- swr option is compatible with web worker option
example: `IDBSideloader` constructor prop
```ts
const loader = new IDBSideloader({ swr: true });
```
example: per-asset basis
```html
```
Optional:
- implement similar API's & behaviors: https://swr.vercel.app/docs/api
see: https://www.mnot.net/blog/2007/12/12/stale
Contributor guide
Research direction
Start at the IDBSideloader constructor and trace the existing cached-data loading and web worker paths. Implement the optional swr constructor and per-asset behavior described in the issue, ensuring cached data is shown before background re-fetching and that the web worker option remains compatible. Done means both constructor and data-swr usage work as specified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100