Simplify setup (#46)
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user