Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class MainViewModel(private val repository: PostsRepository) : ViewModel() {
fun getAllPosts() = repository.getAllPosts()
fun addPost(post: Post) = repository.addPost(post)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment