Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Advice generator app using SvelteKit

Kiyoomi 480

@Jukiyoomi

Desktop design screenshot for the Advice generator app coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
  • API
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


Hey ! I have a little problem with my code. I can't get another advice when I click on the button. I can either get the same advice from the API (I can see it because the loading animation is replayed), or nothing happens at all. Anyone know how I can get another response without reloading the page?

Community feedback

Kyle 30

@YourFavoriteKyle

Posted

For Svelte, I would recommend using Svelte stores to pass around the advice response.

Import getQuote into your Card.svelte component, and when you call it, set the store value to the response.

From there, you can reference the stores values in your Title and Quote components parameters. You can check out my repo if you need to.

https://github.com/YourFavoriteKyle/advice-generator-app-main

I hope this helps!

0

Kiyoomi 480

@Jukiyoomi

Posted

@YourFavoriteKyle Thank you for your response, I will try your idea.

0

@nikeshnaik

Posted

I have done this challenge, check it out. But don't copy-paste it. Try to learn why it is not working. Also, check APIs, there are different types of requests.

https://github.com/nikeshnaik/advice-generator-app-main/blob/master/index.js

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord