-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from matt-ramotar/operation-pipeline
Redesign operation pipeline
- Loading branch information
Showing
26 changed files
with
209 additions
and
269 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 17 additions & 5 deletions
22
...-runtime/src/commonMain/kotlin/org/mobilenativefoundation/storex/paging/runtime/Action.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...time/src/commonMain/kotlin/org/mobilenativefoundation/storex/paging/runtime/Dispatcher.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package org.mobilenativefoundation.storex.paging.runtime | ||
|
||
interface Dispatcher<PageRequestKey: Any> { | ||
suspend fun dispatch(action: Action<PageRequestKey>) | ||
interface Dispatcher<ItemId : Any, PageRequestKey : Any, ItemValue : Any> { | ||
suspend fun dispatch(action: Action<ItemId, PageRequestKey, ItemValue>) | ||
} |
6 changes: 6 additions & 0 deletions
6
...mmonMain/kotlin/org/mobilenativefoundation/storex/paging/runtime/ExperimentalPagingApi.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package org.mobilenativefoundation.storex.paging.runtime | ||
|
||
@RequiresOptIn(message = "This API is experimental. It may be changed in the future without notice.") | ||
@Retention(AnnotationRetention.BINARY) | ||
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) | ||
annotation class ExperimentalPagingApi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
...rc/commonMain/kotlin/org/mobilenativefoundation/storex/paging/runtime/OperationManager.kt
This file was deleted.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
...c/commonMain/kotlin/org/mobilenativefoundation/storex/paging/runtime/OperationPipeline.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package org.mobilenativefoundation.storex.paging.runtime | ||
|
||
interface OperationPipeline<ItemId: Any, PageRequestKey: Any, ItemValue: Any>: List<Operation<ItemId, PageRequestKey, ItemValue>> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 7 additions & 3 deletions
10
...ime/src/commonMain/kotlin/org/mobilenativefoundation/storex/paging/runtime/PagingState.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
package org.mobilenativefoundation.storex.paging.runtime | ||
|
||
import org.mobilenativefoundation.storex.paging.runtime.internal.pager.api.MutableOperationPipeline | ||
|
||
data class PagingState<ItemId : Any>( | ||
|
||
data class PagingState<ItemId : Any, PageRequestKey : Any, ItemValue : Any>( | ||
val ids: List<ItemId?>, | ||
val loadStates: CombinedLoadStates, | ||
val mutableOperationPipeline: MutableOperationPipeline<ItemId, PageRequestKey, ItemValue> | ||
) { | ||
companion object { | ||
fun <ItemId: Any> initial() = PagingState<ItemId>( | ||
fun <ItemId : Any, PageRequestKey : Any, ItemValue : Any> initial() = PagingState<ItemId, PageRequestKey, ItemValue>( | ||
emptyList(), | ||
CombinedLoadStates.initial() | ||
CombinedLoadStates.initial(), | ||
MutableOperationPipeline.empty() | ||
) | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...bilenativefoundation/storex/paging/runtime/internal/pager/api/MutableOperationPipeline.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.mobilenativefoundation.storex.paging.runtime.internal.pager.api | ||
|
||
import org.mobilenativefoundation.storex.paging.runtime.Operation | ||
import org.mobilenativefoundation.storex.paging.runtime.OperationPipeline | ||
import org.mobilenativefoundation.storex.paging.runtime.internal.pager.impl.RealMutableOperationPipeline | ||
|
||
interface MutableOperationPipeline<ItemId : Any, PageRequestKey : Any, ItemValue : Any> : | ||
OperationPipeline<ItemId, PageRequestKey, ItemValue>, MutableList<Operation<ItemId, PageRequestKey, ItemValue>> { | ||
|
||
companion object { | ||
fun <ItemId : Any, PageRequestKey : Any, ItemValue : Any> empty(): MutableOperationPipeline<ItemId, PageRequestKey, ItemValue> { | ||
return RealMutableOperationPipeline(mutableListOf()) | ||
} | ||
} | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.