Skip to content

[Exercise] Implement refresh button event handler #1

Open

Description

@creativcoder

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.

Activity

  1. harshadsabne commented on Oct 22, 2021

    @harshadsabne

    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.

  2. creativcoder commented on Oct 23, 2021

    @creativcoder
    OwnerAuthor

    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

  3. harshadsabne commented on Oct 26, 2021

    @harshadsabne

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    exerciseExercise for beginners

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions