PagingKey
Author
skydoves (Jaewoong Eum)
Since
1.0.0
PagingKey marks the parameter in the service interface method as the paging key. The parameter value decides where to start the paging key.
@GET("pokemon")
@PagingKeyConfig(
keySize = 20,
mapper = PokemonPagingMapper::class
)
public suspend fun fetchPokemonList(
@Query("limit") limit: Int = 20,
@PagingKey @Query("offset") offset: Int = 0, // mark this field as the paging key.
): NetworkPagingSource<PokemonResponse, Pokemon>
Content copied to clipboard