Answers for "svelte mount"

0

svelte mount

<script>
	import { onMount } from 'svelte';

	let photos = [];

	onMount(async () => {
		const res = await fetch(`https://jsonplaceholder.typicode.com/photos?_limit=20`);
		photos = await res.json();
	});
</script>
Posted by: Guest on September-04-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language