add StateFlow<T>.mapState, combineStates(StateFlow<T>...) - #317
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #317 +/- ##
==========================================
+ Coverage 87.79% 89.43% +1.64%
==========================================
Files 37 38 +1
Lines 770 909 +139
Branches 107 107
==========================================
+ Hits 676 813 +137
- Misses 53 55 +2
Partials 41 41 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds new StateFlow utility functions to the FlowExt library, providing convenient methods for mapping and combining StateFlow instances while preserving their state characteristics.
- Adds
StateFlow<T>.mapState()extension function for transforming StateFlow values - Adds
combineStates()functions with 2-12 parameter overloads for combining multiple StateFlows - Includes comprehensive test coverage and API documentation
Reviewed Changes
Copilot reviewed 5 out of 8 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| src/commonMain/kotlin/com/hoc081098/flowext/StateFlows.kt | New file implementing mapState and combineStates functions with internal StateFlow implementations |
| src/commonTest/kotlin/com/hoc081098/flowext/MapStateTest.kt | Test file covering mapState functionality and readonly state flow validation |
| src/commonTest/kotlin/com/hoc081098/flowext/utils/BaseTest.kt | Added helper function for validating readonly StateFlow instances |
| api/FlowExt.api | Updated API dump reflecting new public functions |
| api/FlowExt.klib.api | Updated Kotlin library API dump |
Files not reviewed (2)
- .idea/misc.xml: Language not supported
- .idea/vcs.xml: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
@codex review code |
There was a problem hiding this comment.
Codex Review: Here are some suggestions.
Reply with @codex fix comments to fix any unresolved comments.
About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".
|
@codex review PR |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 7 changed files in this pull request and generated no new comments.
Files not reviewed (2)
- .idea/misc.xml: Generated file
- .idea/vcs.xml: Generated file
Suppressed comments (14)
src/commonMain/kotlin/com/hoc081098/flowext/StateFlows.kt:54
- Remove the duplicated period at the end of this sentence.
* Combine two [StateFlow]s into a new read-only [StateFlow] with the given [transform] function..
src/commonMain/kotlin/com/hoc081098/flowext/StateFlows.kt:75
- Remove the duplicated period at the end of this sentence.
* Combine three [StateFlow]s into a new read-only [StateFlow] with the given [transform] function..
src/commonMain/kotlin/com/hoc081098/flowext/StateFlows.kt:97
- Remove the duplicated period at the end of this sentence.
* Combine four [StateFlow]s into a new read-only [StateFlow] with the given [transform] function..
src/commonMain/kotlin/com/hoc081098/flowext/StateFlows.kt:120
- Remove the duplicated period at the end of this sentence.
* Combine five [StateFlow]s into a new read-only [StateFlow] with the given [transform] function..
src/commonMain/kotlin/com/hoc081098/flowext/StateFlows.kt:144
- Remove the duplicated period at the end of this sentence.
* Combine six [StateFlow]s into a new read-only [StateFlow] with the given [transform] function..
src/commonMain/kotlin/com/hoc081098/flowext/StateFlows.kt:178
- Remove the duplicated period at the end of this sentence.
* Combine seven [StateFlow]s into a new read-only [StateFlow] with the given [transform] function..
src/commonMain/kotlin/com/hoc081098/flowext/StateFlows.kt:214
- Remove the duplicated period at the end of this sentence.
* Combine eight [StateFlow]s into a new read-only [StateFlow] with the given [transform] function..
src/commonMain/kotlin/com/hoc081098/flowext/StateFlows.kt:252
- Remove the duplicated period at the end of this sentence.
* Combine nine [StateFlow]s into a new read-only [StateFlow] with the given [transform] function..
src/commonMain/kotlin/com/hoc081098/flowext/StateFlows.kt:292
- Remove the duplicated period at the end of this sentence.
* Combine ten [StateFlow]s into a new read-only [StateFlow] with the given [transform] function..
src/commonMain/kotlin/com/hoc081098/flowext/StateFlows.kt:336
- Remove the duplicated period at the end of this sentence.
* Combine eleven [StateFlow]s into a new read-only [StateFlow] with the given [transform] function..
src/commonMain/kotlin/com/hoc081098/flowext/StateFlows.kt:382
- Remove the duplicated period at the end of this sentence.
* Combine twelve [StateFlow]s into a new read-only [StateFlow] with the given [transform] function..
src/commonMain/kotlin/com/hoc081098/flowext/StateFlows.kt:64
- The entire
combineStatesoverload family is untested, including collection behavior, equality conflation, livevaluereads, and the 6–12 argument paths that use the project's customcombineoverloads. Please add coverage comparable toCombineTest.kt:38-218; otherwise regressions in these eleven new public APIs will not be detected.
public fun <T1, T2, R> combineStates(
.idea/vcs.xml:8
- This duplicates both inspection entries already present immediately before/after these lines. Duplicate inspection IDs can make IDEA profile loading ambiguous; remove the two added copies.
.idea/misc.xml:4 - This changes the IDE SDK/language level to 21 while the repository explicitly standardizes on JDK 17 in
build.gradle.kts:52-55and.github/workflows/build.yml:27-32. Keep the project metadata aligned so contributors do not need a differently named SDK or accidentally use Java 21 features unsupported by the configured toolchain.
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8ca346fcc5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…nly `StateFlow`s
…ad-only StateFlows
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 24bb0fa328
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ombineStates operators
…guration files [skip ci]
Status
READY/IN DEVELOPMENT/HOLD
Breaking Changes
YES | NO
Description
Type of Change
Requirements