Skip to content

Conversation

@DamianOsipiuk
Copy link
Contributor

Adding 'getObserversCount' util

Reson for making this change:

The observers on the query is private property, therefore Typescript is complaining when trying to use it.

DevTools is using the length of the observers in a couple of places like here

Since this property should probably stay as private, I have added utility to get the observers count as a getter method.

@vercel
Copy link

vercel bot commented Apr 15, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/tannerlinsley/react-query/G762B1aeJNQQaDzaNkqisaKUXx7K
✅ Preview: https://react-query-git-fork-damianosipiuk-feat-observer-coun-061a42.vercel.app

@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 22, 2021

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 c8dd10b:

Sandbox Source
tannerlinsley/react-query: basic Configuration
tannerlinsley/react-query: basic-typescript Configuration

@DamianOsipiuk
Copy link
Contributor Author

@TkDodo Hi, any chance this could be merged? 😉

@TkDodo
Copy link
Collaborator

TkDodo commented Apr 27, 2021

DevTools is using the length of the observers in a couple of places like here

sure, can you maybe use new function then in the devtools and replace the private accesses with it?

@DamianOsipiuk
Copy link
Contributor Author

@TkDodo Sure 👍

@TkDodo
Copy link
Collaborator

TkDodo commented Apr 27, 2021

it's also used in tests with ts-expects-error as far as I can see :)

@TkDodo TkDodo merged commit 79ad5a9 into TanStack:master Apr 28, 2021
@tannerlinsley
Copy link
Member

🎉 This PR is included in version 3.14.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@DamianOsipiuk DamianOsipiuk deleted the feat/observer-count-getter branch July 26, 2021 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants