Rename QueryClient InjectionToken to QueryClientProvider
luii opened this issue · 7 comments
Which @ngneat/query-* package(s) are the source of the bug?
query
Is this a regression?
No
Description
I think it would wise to change the naming of the QueryClient
InjectionToken to QueryClientProvider
.
This way we can avoid the naming conflicts with the QueryClient
in @tanstack/query-core
package.
For now im importing both QueryClient
types from @ngneat/query
and @tanstack/query-core
and rename the first one to get full verbose typing in my code
import {QueryClient} from "@tanstack/query-core";
import {QueryClient as QueryClientProvider} from '@ngneat/query'
class A {
private readonly _queryClient: QueryClient = inject(QueryClientProvider)
}
I think this also makes sense since the QueryClient exported by @ngneat/query
is a Injection Token and not an instantiatable Class.
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in
No response
Anything else?
No response
Do you want to create a pull request?
No
@NetanelBasal if you agree on this, I could create a PR.
Why do you need to import QueryClient
? In your example, there is no need to strictly type the property.
I know that there is no need to explicitly type it, but for an abstract service that will get extended by a couple of concrete services it would make sense when overriding the injection properties
I'd consider it as part of #48 (comment). We need to think about the naming convention.
This is my suggestion - https://github.com/ngneat/query/pull/51/files
Renaming is done.