Joan Colmenero

    Joan Colmenero

    2 years ago
    Hello guys, I'm planning to create an endless scroll-view and I've found this Paging library from the Jetpack, looks very interesting but I do not get one thing, I'm used to from the repository do the mapper to the domain object, so from the use-case/inter-actor I have the domain object already done because I map it on the repository layer, my question is, dis data source that I have to create and this
    PageKeyedDataSource
    where is the correct layer to use it? Because I have to pass an object and don't know if it's the domain object or the response from retrofit.
    Dustin Lam

    Dustin Lam

    2 years ago
    If I'm understanding correctly, you're looking to map the data you load in your datasource to some other type?
    There is a .map api in PageKeyedDataSource
    The DataSource classes are meant to be part of your repository layer