ViewModel

@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class ViewModel(observableDelegates: Array<String>)

Enables generating enhancements for the annotated class.

IMPORTANT: Annotated class has to inherit from BaseViewModel.

Future plans

  • Support extending which property delegates get the observeX properties generated.

  • Drop the requirement of inheriting BaseViewModel and replace it with synthetic inheritance (blocked because of missing support in Kotlin).

  • Support generics.

Constructors

ViewModel
Link copied to clipboard
fun ViewModel(observableDelegates: Array<String> = arrayOf( "published", "collected", "collectedFlatMap", "collectedFlatMapLatest", "binding", "managed", "managedList", ))

Properties

observableDelegates
Link copied to clipboard
val observableDelegates: Array<String>