TanStack / query

🤖 Powerful asynchronous state management, server-state utilities and data fetching for the web. TS/JS, React Query, Solid Query, Svelte Query and Vue Query.
https://tanstack.com/query
MIT License
40.1k stars 2.69k forks source link

fix(angular-query-experimental): allow returning undefined in initialData function #7351

Open ShacharHarshuv opened 2 weeks ago

ShacharHarshuv commented 2 weeks ago

Fix incorrect types that disallowed that. This is necessary because the initialData function can typically read cache synchronously and need to be able to signal to the query if there is a cache miss and an actual fetch needs to be deployed.

Fixes https://github.com/TanStack/query/issues/7341

No breaking changes, any code that worked before should work now as well.

vercel[bot] commented 2 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **query** | ⬜️ Ignored ([Inspect](https://vercel.com/tanstack/query/CUpTpZCNfnVsycLhafTPoY1dQXcN)) | [Visit Preview](https://query-git-fork-shacharharshuv-initialdata-shoul-7ed8cc-tanstack.vercel.app) | | May 8, 2024 6:29pm |
codesandbox-ci[bot] commented 2 weeks ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 4cfa6ffb73fd31d3420cb7eef22e11f0677a58af:

Sandbox Source
@tanstack/query-example-angular-basic Configuration
@tanstack/query-example-react-basic-typescript Configuration
@tanstack/query-example-solid-basic-typescript Configuration
@tanstack/query-example-svelte-basic Configuration
@tanstack/query-example-vue-basic Configuration
ShacharHarshuv commented 2 weeks ago

It seems like the styling changes were done automatically on commit by lint-staged. Let me know if you think something in my set up is wrong and it shouldn't have happened.

ShacharHarshuv commented 2 weeks ago

I fixed the prettier issue

ShacharHarshuv commented 2 weeks ago

@TkDodo Done!

nx-cloud[bot] commented 2 weeks ago

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 4cfa6ffb73fd31d3420cb7eef22e11f0677a58af. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target - [`nx affected --targets=test:format,test:sherif,test:knip,test:eslint,test:lib,test:types,test:build,build,test:attw --parallel=3`](https://cloud.nx.app/runs/T1gJeqs6VC?utm_source=pull-request&utm_medium=comment)

Sent with 💌 from NxCloud.

ShacharHarshuv commented 2 weeks ago

@TkDodo @arnoud-dv Can this be merged?

arnoud-dv commented 4 days ago

Looks good to me, @TkDodo agree if we merge this?