package com.maniu.mn_vip_jetpack_other.paging;

import androidx.lifecycle.MutableLiveData;
import androidx.paging.DataSource;

/**
 * 得创建工厂类，用来创建DataSource对象
 */
public class ConcertFactory extends DataSource.Factory<Integer, Concert> {

    private MutableLiveData<ConcertDataSource> mSourceLiveData =
            new MutableLiveData<>();

    @Override
    public DataSource<Integer, Concert> create() {
        ConcertDataSource concertDataSource = new ConcertDataSource();
        mSourceLiveData.postValue(concertDataSource);
        return concertDataSource;
    }
}
