-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Final RTKQ alpha feedback, fixes, and tweaks #1023
Comments
Can't wait to test RTK-Query in my new projects! Minor note, in the changelog the import path is |
@mgcrea Thanks, updated it. |
Yeah, we need to go through and add visibility attributes to all types so we stop getting extraction warnings. |
Running list of merged PRs since
|
just some minor tweaks 😆 Still missing on that list:
And then I think I'm actually really out of ideas on what else to add. |
First of all, excellent functionalities for RTK query, start refactoring our codes by adopting alpha.2, can't wait the official release. |
@bravew : phryneas mentioned on Discord that this could be done by wrapping baseQuery, as that have access to import { fetchBaseQuery } from '@rtk-incubator/rtk-query';
import { createApi } from '@rtk-incubator/rtk-query/react';
const baseQuery = fetchBaseQuery({
baseUrl: 'http://localhost:8000/'
});
const wrappedBaseQuery = (
...[args, api, extraOptions]: Parameters<typeof baseQuery>
) => {
const partialUrl = typeof (args) === 'string' ? args : args.url
const projectId = (api.getState() as any).auth.projectId // circular reference if as RootState
const url = `project/${projectId}/${partialUrl}`
const newArgs = typeof (args) === 'string' ? url : { ...args, url }
return baseQuery(newArgs, api, extraOptions)
}
export const api = createApi({
baseQuery: wrappedBaseQuery,
... (Note that I haven't updated to next RTK, so i'm using the old imports) |
@StefanBRas , Thanks a lot , your code provides the last piece of our puzzle. |
@Shrugsy that snippet seems worth adding to "Customizing Queries" |
🚀 |
Gotta resolve any issues that get reported during the alpha, and apply any final changes left over from the old repo.
The text was updated successfully, but these errors were encountered: