Skip to content

Instantly share code, notes, and snippets.

@steliosfran
Last active March 13, 2022 23:57
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 steliosfran/8a4f632a21f5d527734a23f3f084c3b0 to your computer and use it in GitHub Desktop.
Save steliosfran/8a4f632a21f5d527734a23f3f084c3b0 to your computer and use it in GitHub Desktop.
class MyAdapter(
private val context: Context
) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
init {
viewModel.items.observe(context as LifecycleOwner) {
// Update items and dispatch updates
}
}
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment