Created
November 14, 2019 12:55
-
-
Save manuelvicnt/852824961588fd00612ca7c27d7609de to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Copyright 2019 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 */ | |
// Simplified version of the real code | |
class SessionDetailViewModel( | |
private val loadUserSessionUseCase: LoadUserSessionUseCase, | |
... | |
): ViewModel() { | |
private fun listenForUserSessionChanges(sessionId: SessionId) { | |
viewModelScope.launch { | |
loadUserSessionUseCase(sessionId).collect { loadResult -> | |
// Update multiple LiveDatas to notify the View | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment