Riff / Built on the open web / Platform
Fetch
Swaps library views in from the REST route without a page load.

How Riff uses it
The Listen app fetches the library and each post from the plugin's REST route with a JSON Accept header, and memoises each promise so going back is instant. A non-2xx response throws and the entry is dropped from the cache.
Why
Swapping views without a page load is what keeps the music playing, and the cache is why Back feels instant.
Without it
A failed fetch sends the browser to the real URL with a full navigation.
Where
- plugins/riff/features/listen/app.js, line 68
fetch( key, { - plugins/riff/features/listen/app.js, line 92
location.assign( addressOf( id ) );
Links open the source at the commit this page was published from.
Reference: Fetch on MDN.