i18next / i18next-localstorage-backend

This is a i18next cache layer to be used in the browser. It will load and cache resources from localStorage and can be used in combination with the chained backend.
MIT License
88 stars 43 forks source link

SWR behavior #42

Open wong2 opened 1 year ago

wong2 commented 1 year ago

🚀 Feature Proposal

Implement SWR behavior, that the cached data is returned while new data are fetched in the background.

Motivation

This can help prevent the splash blank page while the translation data are loading.

adrai commented 1 year ago

Feel free to try a PR

jamuhl commented 1 year ago

Only worth on very slow networks IMO. Not something that this backend can solve.

You might have to create a new backend like https://github.com/i18next/i18next-chained-backend that does all the magic: