Skip to content

Instantly share code, notes, and snippets.

@florina-muntenescu
Created December 6, 2020 20:36
Show Gist options
  • Save florina-muntenescu/5028e1999c398c4d42480fdf767f4a51 to your computer and use it in GitHub Desktop.
Save florina-muntenescu/5028e1999c398c4d42480fdf767f4a51 to your computer and use it in GitHub Desktop.
/* Copyright 2020 Google LLC.
SPDX-License-Identifier: Apache-2.0 */
- wordViewModel.allWords.observe(
- this,
- Observer { words ->
- // Update the cached copy of the words in the adapter.
- words?.let { adapter.submitList(it) }
- }
- )
+ wordViewModel.allWords.observe(owner = this) { words ->
+ // Update the cached copy of the words in the adapter.
+ words.let { adapter.submitList(it) }
+ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment