Skip to content

fix: explicitly type electricCollectionOptions return value#502

Closed
pawelblaszczyk5 wants to merge 1 commit intoTanStack:mainfrom
pawelblaszczyk5:explicit-electric-return-type
Closed

fix: explicitly type electricCollectionOptions return value#502
pawelblaszczyk5 wants to merge 1 commit intoTanStack:mainfrom
pawelblaszczyk5:explicit-electric-return-type

Conversation

@pawelblaszczyk5
Copy link
Contributor

Fixes #392

Currently, if someone used exactOptionalPropertyTypes in their tsconfig return type from electricCollectionOptions wasn't assignable to createCollection. This could be observed in the example in the repository, when added the flag to the tsconfig:

image

After the fix in the PR:

image

@changeset-bot
Copy link

changeset-bot bot commented Sep 5, 2025

🦋 Changeset detected

Latest commit: f1a8e30

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@tanstack/electric-db-collection Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 5, 2025

More templates

@tanstack/db

npm i https://pkg.pr.new/@tanstack/db@502

@tanstack/db-ivm

npm i https://pkg.pr.new/@tanstack/db-ivm@502

@tanstack/electric-db-collection

npm i https://pkg.pr.new/@tanstack/electric-db-collection@502

@tanstack/query-db-collection

npm i https://pkg.pr.new/@tanstack/query-db-collection@502

@tanstack/react-db

npm i https://pkg.pr.new/@tanstack/react-db@502

@tanstack/solid-db

npm i https://pkg.pr.new/@tanstack/solid-db@502

@tanstack/svelte-db

npm i https://pkg.pr.new/@tanstack/svelte-db@502

@tanstack/trailbase-db-collection

npm i https://pkg.pr.new/@tanstack/trailbase-db-collection@502

@tanstack/vue-db

npm i https://pkg.pr.new/@tanstack/vue-db@502

commit: f1a8e30

@kevin-dp
Copy link
Contributor

There is a major refactoring of the types under review (#530). I will come back to this PR on Monday to see if this is still needed with the new types or not. Thanks!

@pawelblaszczyk5
Copy link
Contributor Author

Thanks a lot for taking time to look into it - from quick glance it seems like it’ll also fix the issue. Subscribed it, so I’ll also test whether it’s necessary when it got merged :)

@pawelblaszczyk5
Copy link
Contributor Author

I see that it was merged and from what I checked, it's fixed now, so closing it, thank you very much ;)

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Types mismatch between electricCollectionOptions and createCollection

2 participants