package com.cartoon.wallpapers.live.vm;

import androidx.lifecycle.LiveData;
import androidx.lifecycle.ViewModel;
import androidx.paging.Pager;
import androidx.paging.PagingConfig;
import androidx.paging.PagingData;
import androidx.paging.PagingLiveData;

import com.cartoon.wallpapers.live.mydata.ResultData;
import com.cartoon.wallpapers.live.page.MyPageSource;


public class ViewModeMain extends ViewModel {

    public LiveData<PagingData<ResultData>> getPagingData(int wallpaperType) {

        return PagingLiveData.getLiveData(new Pager<>(
                new PagingConfig(10),
                () -> new MyPageSource(wallpaperType)
        ));
    }

}
