Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-ramotar committed Feb 17, 2024
1 parent 55f5160 commit 9bdae15
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ import org.mobilenativefoundation.store.core5.StoreKey
@ExperimentalStoreApi
interface Joiner<Id : Any, K : StoreKey<Id>, SO : StoreData.Single<Id>> {
suspend operator fun invoke(data: Map<K, PagingData<Id, SO>>): PagingData<Id, SO>
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ import org.mobilenativefoundation.store.core5.StoreKey
@ExperimentalStoreApi
interface KeyFactory<Id : Any, SK : StoreKey.Single<Id>> {
fun createFor(id: Id): SK
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ interface Pager<Id : Any, K : StoreKey<Id>, SO : StoreData.Single<Id>> {
)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ import org.mobilenativefoundation.store.core5.StoreData
@ExperimentalStoreApi
data class PagingData<Id : Any, SO : StoreData.Single<Id>>(
val items: List<SO>
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -148,16 +148,11 @@ internal class RealPager<Id : Any, SK : StoreKey.Single<Id>, K : StoreKey<Id>, S
}
}
}

}
}
}
}

private fun emptyPagingData() = PagingData<Id, SO>(emptyList())
private fun pagingDataFrom(items: List<SO>) = PagingData(items)

}



Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import org.mobilenativefoundation.store.store5.StoreReadResponse
@ExperimentalStoreApi
internal interface Streamer<Id : Any, K : StoreKey<Id>, O : StoreData<Id>> {
operator fun invoke(key: K): Flow<StoreReadResponse<O>>
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ class PostJoiner : Joiner<String, PostKey, PostData.Post> {

return PagingData(combinedItems)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ sealed class PostKey : StoreKey<String> {
) : StoreKey.Single<String>, PostKey()
}


@OptIn(ExperimentalStoreApi::class)
class PostKeyFactory : KeyFactory<String, PostKey.Single> {
override fun createFor(id: String): PostKey.Single {
return PostKey.Single(id)
}
}
}

0 comments on commit 9bdae15

Please sign in to comment.