T-Sajad / football-scores-app

1 stars 0 forks source link

Live data 4: Add a refresh button #10

Open josephjclark opened 8 months ago

josephjclark commented 8 months ago

At the moment, your app will fetch data from a server and cache it.

When you refresh the page, data always comes from the local storage.

You can clear your local storage from the developer tools in your browser (the Application tab in devtools will show you your local storage). But this isn't very user friendly.

So we need to:

When the data loader is called without any data in local storage, it will call up to the API and fetch data down again.

Now your user can control when data should be refreshed.

Later, if you like, you can try to automate this strategy:

If you do either of these things, you should still keep the Refresh button as a fallback strategy for users.