package com.hd.live.wallpapers.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.hd.live.wallpapers.bean.ResultData;
import com.hd.live.wallpapers.page.MyPageSource;


public class VmHome extends ViewModel {

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

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

}
