query icon indicating copy to clipboard operation
query copied to clipboard

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

Open ShacharHarshuv opened this issue 9 months ago • 8 comments

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.

ShacharHarshuv avatar Apr 29 '24 14:04 ShacharHarshuv

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

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
query ⬜️ Ignored (Inspect) Visit Preview May 8, 2024 6:29pm

vercel[bot] avatar Apr 29 '24 14:04 vercel[bot]

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

codesandbox-ci[bot] avatar Apr 29 '24 14:04 codesandbox-ci[bot]

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 avatar Apr 29 '24 15:04 ShacharHarshuv

I fixed the prettier issue

ShacharHarshuv avatar Apr 29 '24 18:04 ShacharHarshuv

@TkDodo Done!

ShacharHarshuv avatar Apr 29 '24 21:04 ShacharHarshuv

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 80053f10f6d368c5d4b80babc1acf4484df1b017. 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 2 targets

Sent with 💌 from NxCloud.

nx-cloud[bot] avatar Apr 29 '24 21:04 nx-cloud[bot]

@TkDodo @arnoud-dv Can this be merged?

ShacharHarshuv avatar May 02 '24 14:05 ShacharHarshuv

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

arnoud-dv avatar May 12 '24 12:05 arnoud-dv

sorry, this somehow slipped through my queue. will merge now.

TkDodo avatar Aug 01 '24 13:08 TkDodo

commit: 80053f1

pnpm add https://pkg.pr.new/@tanstack/angular-query-devtools-experimental@7351
pnpm add https://pkg.pr.new/@tanstack/angular-query-experimental@7351
pnpm add https://pkg.pr.new/@tanstack/eslint-plugin-query@7351
pnpm add https://pkg.pr.new/@tanstack/query-async-storage-persister@7351
pnpm add https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@7351
pnpm add https://pkg.pr.new/@tanstack/query-core@7351
pnpm add https://pkg.pr.new/@tanstack/query-devtools@7351
pnpm add https://pkg.pr.new/@tanstack/query-persist-client-core@7351
pnpm add https://pkg.pr.new/@tanstack/query-sync-storage-persister@7351
pnpm add https://pkg.pr.new/@tanstack/react-query@7351
pnpm add https://pkg.pr.new/@tanstack/react-query-devtools@7351
pnpm add https://pkg.pr.new/@tanstack/react-query-next-experimental@7351
pnpm add https://pkg.pr.new/@tanstack/react-query-persist-client@7351
pnpm add https://pkg.pr.new/@tanstack/solid-query@7351
pnpm add https://pkg.pr.new/@tanstack/solid-query-devtools@7351
pnpm add https://pkg.pr.new/@tanstack/solid-query-persist-client@7351
pnpm add https://pkg.pr.new/@tanstack/svelte-query@7351
pnpm add https://pkg.pr.new/@tanstack/svelte-query-devtools@7351
pnpm add https://pkg.pr.new/@tanstack/svelte-query-persist-client@7351
pnpm add https://pkg.pr.new/@tanstack/vue-query@7351
pnpm add https://pkg.pr.new/@tanstack/vue-query-devtools@7351

Open in Stackblitz

More templates

pkg-pr-new[bot] avatar Aug 01 '24 13:08 pkg-pr-new[bot]