Repository navigation
fix(types): allow andThen and andCatch to return partial PropsMapInner - #276
Open
AlirezaAghaee1996 wants to merge 1 commit into
Open
AlirezaAghaee1996 wants to merge 1 commit into
AlirezaAghaee1996 wants to merge 1 commit into
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 Autonomous Contribution by OpenSourcePilot
Summary of Changes
Resolves #243: Example in README cannot be compiled in TypeScript
🔍 Root Cause Analysis
The TypeScript definitions in
src/index.d.tsforandThenandandCatchspecify that they returnPropsMap<TProps>, which mandates that all properties defined inTProps(including all fetched props) must be returned in the object literal insideandThen. However, in practice (as shown in the README example),andThencan return partial maps where only some dependent properties (likebarFetch) are returned without having to re-declare every single prop inTProps.🛠 Solution Strategy
Update
andThenandandCatchreturn types insrc/index.d.tsfromPropsMap<TProps>to a partial or flexible mapping type (e.g.,PropsMapInner<TProps>) so that returning a subset of properties in chained requests successfully compiles.📁 Modified Files
src/index.d.ts(modify)🧪 Verified Test Results
This Pull Request was generated autonomously by OpenSourcePilot after passing an isolated Docker verification test suite and independent automated code review.