Skip to content

Commit 709fad2

Browse files
committed
chore: address review nitpicks (JSDoc + test cleanup)
1 parent 2749ece commit 709fad2

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

packages/query-core/src/__tests__/streamedQuery.test.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,12 @@ describe('streamedQuery', () => {
129129
})
130130

131131
test('should handle empty streams', async () => {
132-
133132
const key = queryKey()
134133

135134
const observer = new QueryObserver(queryClient, {
136135
queryKey: key,
137136
queryFn: streamedQuery({
138-
streamFn: () => { return {async *[Symbol.asyncIterator]() {}}},
137+
streamFn: async function* () {},
139138
}),
140139
})
141140

@@ -156,7 +155,6 @@ describe('streamedQuery', () => {
156155
})
157156

158157
unsubscribe()
159-
160158
})
161159

162160
test('should replace on refetch', async () => {

packages/query-core/src/streamedQuery.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ type StreamedQueryParams<TQueryFnData, TData, TQueryKey extends QueryKey> =
4141
* Set to `'replace'` to write all data to the cache once the stream ends.
4242
* @param reducer - A function to reduce the streamed chunks into the final data.
4343
* Defaults to a function that appends chunks to the end of the array.
44-
* @param initialValue - Initial value to be used while the first chunk is being fetched.
44+
* @param initialValue - Initial value to be used while the first chunk is being fetched, and returned if the stream yields no values.
4545
*/
4646
export function streamedQuery<
4747
TQueryFnData = unknown,

0 commit comments

Comments
 (0)