Skip to content

Instantly share code, notes, and snippets.

@fayaz07
Created September 3, 2022 01:29
Show Gist options
  • Save fayaz07/0246bac3fa2da49b7551344431e14a85 to your computer and use it in GitHub Desktop.
Save fayaz07/0246bac3fa2da49b7551344431e14a85 to your computer and use it in GitHub Desktop.
class CreateViewModel(private val todoDao: TodoDao) : ViewModel() {
fun create(task: String) {
viewModelScope.launch {
todoDao.insert(NewTodo(task))
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment