Search in sources :

Example 1 with FeedViewModel

use of com.mindorks.framework.mvvm.ui.feed.FeedViewModel in project android-mvvm-architecture by MindorksOpenSource.

the class ActivityModule method provideFeedViewModel.

@Provides
FeedViewModel provideFeedViewModel(DataManager dataManager, SchedulerProvider schedulerProvider) {
    Supplier<FeedViewModel> supplier = () -> new FeedViewModel(dataManager, schedulerProvider);
    ViewModelProviderFactory<FeedViewModel> factory = new ViewModelProviderFactory<>(FeedViewModel.class, supplier);
    return new ViewModelProvider(activity, factory).get(FeedViewModel.class);
}
Also used : FeedViewModel(com.mindorks.framework.mvvm.ui.feed.FeedViewModel) ViewModelProviderFactory(com.mindorks.framework.mvvm.ViewModelProviderFactory) ViewModelProvider(androidx.lifecycle.ViewModelProvider) Provides(dagger.Provides)

Aggregations

ViewModelProvider (androidx.lifecycle.ViewModelProvider)1 ViewModelProviderFactory (com.mindorks.framework.mvvm.ViewModelProviderFactory)1 FeedViewModel (com.mindorks.framework.mvvm.ui.feed.FeedViewModel)1 Provides (dagger.Provides)1