Love Bacon?
I love bacon so Lorem Ipsum Bacon is my favorite filler text. Svelte has a component system also called components. Fancy that! To demonstrate this, I made a Baconsum component. Which uses the BaconSum API endpoint. Now I can generate random bacon text on demand.
It defaults to 4 paragraphs but you can change that by passing a "p"
property to the Baconsum component.
<Baconsum p=2 /> for 2 paragraphs,
<Baconsum p=3 /> for 3 paragraphs, etc.
<Baconsum /> will default to 4 paragraphs,
But wait, there's more! Lets add a delay instead of hard coding the
delay of 5000ms. Default but also allow an override. Now I can do p
or d or dp, I guess pd also.
<Baconsum d=4000 p=2 /> for 2 paragraphs and refresh in 4000ms,
<Baconsum d=8000 p=3 /> for 3 paragraphs and refresh in 8000ms
<Baconsum /> will default to 4 paragraphs and will refresh in 5000ms
(default)