File tree Expand file tree Collapse file tree 1 file changed +10
-16
lines changed
packages/clients/tanstack-query/src/utils Expand file tree Collapse file tree 1 file changed +10
-16
lines changed Original file line number Diff line number Diff line change @@ -31,19 +31,13 @@ export type TrimDelegateModelOperations<
3131 T extends Record < string , unknown > ,
3232> = IsDelegateModel < Schema , Model > extends true ? Omit < T , HooksOperationsIneligibleForDelegateModels > : T ;
3333
34- export type WithOptimistic < T > =
35- T extends Array < infer U >
36- ? Array <
37- U & {
38- /**
39- * Indicates if the item is in an optimistic update state
40- */
41- $optimistic ?: boolean ;
42- }
43- >
44- : T & {
45- /**
46- * Indicates if the item is in an optimistic update state
47- */
48- $optimistic ?: boolean ;
49- } ;
34+ type WithOptimisticFlag < T > = T extends object
35+ ? T & {
36+ /**
37+ * Indicates if the item is in an optimistic update state
38+ */
39+ $optimistic ?: boolean ;
40+ }
41+ : T ;
42+
43+ export type WithOptimistic < T > = T extends Array < infer U > ? Array < WithOptimisticFlag < U > > : WithOptimisticFlag < T > ;
You can’t perform that action at this time.
0 commit comments