Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Exercise] Implement refresh button event handler #1

Open
creativcoder opened this issue Oct 19, 2021 · 3 comments
Open

[Exercise] Implement refresh button event handler #1

creativcoder opened this issue Oct 19, 2021 · 3 comments
Labels
exercise Exercise for beginners

Comments

@creativcoder
Copy link
Owner

creativcoder commented Oct 19, 2021

In part b, we finished headlines but left the refresh button event handler for grab.

As an exercise, it would be great to implement the refresh button event handler.

We want the following behavior:

When the refresh button is clicked, the app should momentarily render a loading screen, and then make another get request to top-headlines endpoint and re-populate the list of articles.

Feel free to reach out for queries.

@creativcoder creativcoder added the exercise Exercise for beginners label Oct 19, 2021
@harshadsabne
Copy link

Hi @creativcoder,
I am totally new to Rust (and hence new to egui etc too) but wanted to give this a try. I was able to do a hacky change to implement this but would like to know what would be the optimized way for the same. Here is my demo:

demo

Thank you.

@creativcoder
Copy link
Owner Author

Hey that's a great start :) Thanks for trying! I can see it working as expected, but it seems to be blocked during the http fetch. If you'd like to share the branch you're working on, I can help out

@harshadsabne
Copy link

Hi there! I created a PR here: #2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exercise Exercise for beginners
Projects
None yet
Development

No branches or pull requests

2 participants