Refresh data from a network using LiveData
I am working on an app that queries the github api to get a list of user and i'm following the recommended android architecture component guide . Once the data is fetched from the network, I store it locally using Room DB and then display it on the UI using ViewModel that observes on the LiveData object (this works fine). However, I want to be able to have a button which when clicked would trigger a refresh action and perform a network request to get new data from the API if and only if there is a network connection. The issue is when I click the button, two network calls are triggered, one