ca-love / lounge

Lounge is an Android library for building Leanback user interface required by Android TV.
https://ca-love.github.io/lounge/
MIT License
12 stars 1 forks source link

Interceptor to avoid submit empty models #12

Closed lcdsmao closed 3 years ago

lcdsmao commented 3 years ago

⚠️ Is your feature request related to a problem? Please describe

override fun buildModels {
  if (loading) return
  if (list.isEmpty) return
  list.map { it.toModel() }
}

We may want to only submit built models when list loaded and list is not empty.

💡 Describe the solution you'd like

Combine LoungeControllerInterceptor and awaitCancellation() when built models is empty should solve this promblem.

🤚 Do you want to develop this feature yourself?