fix: pass generic type T through to FetchOptions in interface (#559)#560
fix: pass generic type T through to FetchOptions in interface (#559)#560guoyangzhen wants to merge 1 commit into
Conversation
…njs#559) The $Fetch interface accepts <T, R> generics but only passes R to FetchOptions<R>, leaving T defaulting to any. This means FetchContext and FetchResponse in hooks always have any type. Fixed by passing T through: FetchOptions<R> → FetchOptions<R, T>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughUpdated the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Problem
The `` interface accepts
<T, R>generics but only passes `R` to `FetchOptions`, leaving `T` defaulting to `any`. This means `FetchContext` and `FetchResponse` in hooks always have `any` type:Fix
Pass
Tthrough toFetchOptionsin both the main call andrawmethod:This is a pure type-level change with no runtime impact.
Related
Fixes #559
Summary by CodeRabbit
Release Notes