Cache Then Network

Serve the stored copy immediately, then the fresh one, from a single repository flow — and emit an error only when nothing was served, because an error after a successful emission replaces working content the user is already reading. Use when a screen shows a spinner on every open despite having shown the same data a minute ago, or when a brief network failure blanks a screen that had perfectly good content on it.

maxrave-dev Updated 2.3k repo stars
The SimpMusic repository on GitHub

File contents

maxrave-dev/kotlin-footguns commit 4f954929c0

Frequently asked questions

npx get-skill add maxrave-dev/cache-then-network