Files
oki-podcast-reader/src/routes/api/code/user_progress-subscribe.svelte
T
2023-07-13 00:27:14 +01:00

17 lines
404 B
Svelte

<script>
import { user_progress } from 'svelte-podcast';
// return the current user progress
const progress = $user_progress;
// or subscribe to changes in the user progress
user_progress.subscribe((prog) => {
// do something with the new progress whenever they change
console.log(prog);
});
</script>
<p>
Listened to {progress['https://example.com/episodes/1']} seconds of episode 1.
</p>