ViewModelInitializer


public final class ViewModelInitializer<T extends ViewModel>


Holds a ViewModel class and initializer for that class

Summary

Public constructors

<T extends ViewModel> ViewModelInitializer(
    @NonNull Class<@NonNull T> clazz,
    @ExtensionFunctionType @NonNull Function1<@NonNull CreationExtras, @NonNull T> initializer
)

Construct a new ViewModelInitializer instance.

<T extends ViewModel> ViewModelInitializer(
    @NonNull KClass<@NonNull T> clazz,
    @ExtensionFunctionType @NonNull Function1<@NonNull CreationExtras, @NonNull T> initializer
)

Public constructors

ViewModelInitializer

public <T extends ViewModel> ViewModelInitializer(
    @NonNull Class<@NonNull T> clazz,
    @ExtensionFunctionType @NonNull Function1<@NonNull CreationExtras, @NonNull T> initializer
)

Construct a new ViewModelInitializer instance.

Parameters
@NonNull Class<@NonNull T> clazz

ViewModel class with which the specified initializer is to be associated.

@ExtensionFunctionType @NonNull Function1<@NonNull CreationExtras, @NonNull T> initializer

factory lambda to be associated with the specified ViewModel class.

ViewModelInitializer

public <T extends ViewModel> ViewModelInitializer(
    @NonNull KClass<@NonNull T> clazz,
    @ExtensionFunctionType @NonNull Function1<@NonNull CreationExtras, @NonNull T> initializer
)