Skip to content

Commit 3677b3d

Browse files
authored
Merge pull request #13 from softnetics/yu/fix/optimistic-update-type
Fix: optimistic update type to return undefined if prev does not exists
2 parents 4c2d789 + 1e9eb7a commit 3677b3d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/wild-monkeys-knock.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@softnetics/hono-react-query": patch
3+
---
4+
5+
Fix: optimistic update type to return undefined if prev does not exists

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ export type UseHonoOptimisticUpdateQuery<TApp extends Record<string, any>> = <
229229
) => (
230230
updater: (
231231
prev: SuccessResponse<InferFunctionReturn<TApp[TPath][TMethod]>> | undefined
232-
) => SuccessResponse<InferFunctionReturn<TApp[TPath][TMethod]>>
232+
) => SuccessResponse<InferFunctionReturn<TApp[TPath][TMethod]>> | undefined
233233
) =>
234234
| {
235235
previous: SuccessResponse<InferFunctionReturn<TApp[TPath][TMethod]>> | undefined

0 commit comments

Comments
 (0)