0
Fork 0
mirror of https://github.com/TanStack/query.git synced 2026-11-16 22:50:20 +00:00
Commit graph

12 commits

Author SHA1 Message Date
Lachlan Collins
5ad78fc4ad
docs: correct local relative links (#9947)
* docs: correct local relative links

* Update links

* Slight tweaks

* String
2025-12-05 22:39:25 +11:00
ahmethos
eb559a66dc
fix(streamedQuery): fall back to initialValue when stream yields no values (#9876)
* fix(streamedQuery): fall back to initialValue when stream yields no values

Add failing test for empty streams and update implementation to avoid returning undefined.
Includes changeset for patch release.

* chore: address review nitpicks (JSDoc + test cleanup)

* docs: note that initialValue is returned when the stream yields no values

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2025-11-16 19:19:44 +01:00
Dominik Dorfmeister
b25412a9e3
ref: rename queryFn to streamFn in streamedQuery (#9606)
* ref: rename queryFn to streamFn in streamedQuery

this avoids the weirdly double-nested queryFn naming

* chore: docs

* fix: docs
2025-09-04 11:19:15 +02:00
marco gobbi
8f24580fda
feat(query-core): add custom reducer support to streamedQuery (#9532)
* feat(query-core): add custom reducer support to streamedQuery

Replace maxChunks parameter with flexible reducer function that delegates
data aggregation to consumer code. This provides full control over how
streamed chunks are combined into the final data structure.

Add support for custom placeholderData that works seamlessly with the
reducer function, allowing initialization of complex data types beyond
simple arrays.

https://github.com/TanStack/query/discussions/9065

BREAKING CHANGE: The maxChunks parameter has been removed from streamedQuery.
Use a custom reducer function to control data aggregation behavior instead.

* ci: apply automated fixes

* feat(query-core): require initialValue when using custom reducer in streamedQuery

Add type safety by making initialValue mandatory when providing a custom
reducer function. This prevents runtime errors and ensures proper data
initialization for custom data structures beyond simple arrays.

Use conditional types to enforce the relationship between reducer and
initialValue parameters, maintaining backward compatibility for simple
array-based streaming while requiring explicit initialization for
custom reducers.

BREAKING CHANGE: When using a custom reducer function with streamedQuery,
the initialValue parameter is now required and must be provided.

* feat(query-core): require initialValue when using custom reducer in streamedQuery

Add type safety by making initialValue mandatory when providing a custom
reducer function. This prevents runtime errors and ensures proper data
initialization for custom data structures beyond simple arrays.

Use conditional types to enforce the relationship between reducer and
initialValue parameters, maintaining backward compatibility for simple
array-based streaming while requiring explicit initialization for
custom reducers.

BREAKING CHANGE: When using a custom reducer function with streamedQuery,
the initialValue parameter is now required and must be provided.

* feat(query-core): require initialValue when using custom reducer in streamedQuery

Add type safety by making initialValue mandatory when providing a custom
reducer function. This prevents runtime errors and ensures proper data
initialization for custom data structures beyond simple arrays.

Use conditional types to enforce the relationship between reducer and
initialValue parameters, maintaining backward compatibility for simple
array-based streaming while requiring explicit initialization for
custom reducers.

BREAKING CHANGE: When using a custom reducer function with streamedQuery,
the initialValue parameter is now required and must be provided.

* removed personal vscode workspace file

* updated documentation

* fix(docs): clarify reducer function description in streamedQuery documentation

* ci: apply automated fixes

* fix(tests): Code Review :: update streamedQuery tests to use correct initialValue type

---------

Co-authored-by: gobbimar <marco.gobbi@adidas.com>
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-09-04 11:03:41 +02:00
Dominik Dorfmeister
9973e0f1d8
feat: maxChunks (#9184) 2025-05-24 09:22:00 +02:00
autofix-ci[bot]
20c36c8bf3
ci: apply automated fixes 2025-05-24 06:48:59 +00:00
Tanner Linsley
afc6302dbf docs: fix links
commit 113eb6ba963534fe80b3e96193d767bf769c8bff
Author: Tanner Linsley <tannerlinsley@gmail.com>
Date:   Fri May 23 23:16:11 2025 -0600

    docs: fix: only transform generated reference

commit d1d084ed9026e31ba746e1bb87d5c19183a7d148
Author: Tanner Linsley <tannerlinsley@gmail.com>
Date:   Fri May 23 23:12:07 2025 -0600

    docs: fix broken links

commit 0df59ea7d8afb16be86ae917fc46900b6e999351
Author: Tanner Linsley <tannerlinsley@gmail.com>
Date:   Fri May 23 15:54:19 2025 -0600

    fix: rewrite type doc links to be directory-relative

commit 81e4c71f1c9250005f164b7e585837ee0ad14e23
Author: Tanner Linsley <tannerlinsley@gmail.com>
Date:   Fri May 23 15:14:51 2025 -0600

    fix: initial fix for ./ => ../
2025-05-24 00:47:55 -06:00
Dominik Dorfmeister
ff0131b142
feat(query-core): refetchMode “replace” for streamedQuery (#9092)
* refetchmode replace

* feat: refetchMode replace for streamedQuery

* test: should allow arrays
2025-05-01 15:24:59 +02:00
Dominik Dorfmeister
a2a39c92f1
docs: fix typo 2025-04-25 14:35:41 +02:00
Dominik Dorfmeister
c987abcafe
docs: Update streamedQuery.md 2025-04-25 10:37:57 +02:00
MINSEONG KIM
7cb634b6b3
docs: typo (#8932) 2025-04-02 08:46:03 +02:00
Dominik Dorfmeister
4d67c1cfa3
feat(core): streamedQuery (#8814)
* feat: streamedQuery

* feat: streaming example

* chore: move

* chore: fix lock file

* docs: streamedQuery
2025-03-18 12:09:51 +01:00