Skip to content

Instantly share code, notes, and snippets.

@shahbazahmed1269
Created June 10, 2017 06:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shahbazahmed1269/3c58008e6a1e6664bd8e98d9474d3f35 to your computer and use it in GitHub Desktop.
Save shahbazahmed1269/3c58008e6a1e6664bd8e98d9474d3f35 to your computer and use it in GitHub Desktop.
Part of my 2nd blog post on architecture components and MVVM
public class ListIssuesViewModel extends ViewModel {
private MediatorLiveData<ApiResponse> mApiResponse;
private IssueRepository mIssueRepository;
@Inject
public ListIssuesViewModel(IssueRepository issueRepository) {
mApiResponse = new MediatorLiveData<>();
mIssueRepository = issueRepository;
}
// Other code remains unchanged ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment