Skip to content
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

add endpoint, type and forced to BaseQueryApi and prepareHeaders #1656

Merged
merged 5 commits into from
Oct 28, 2021

Conversation

phryneas
Copy link
Member

This still needs tests & adjustments for existing tests.

It should unlock quite some behavior around Cache-Control headers.

(Number(new Date()) - Number(fulfilledVal)) / 1000 >= refetchVal
)
}
if (fulfilledVal)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved that out to also be able to call it elsewhere. Could someone (@msutkowski you were working on this with me?) please verify that I didn't break the logic?

@github-actions
Copy link

github-actions bot commented Oct 28, 2021

size-limit report 📦

Path Size
1. entry point: @reduxjs/toolkit (cjs.production.min.js) 12.28 KB (0%)
1. entry point: @reduxjs/toolkit (esm.js) 10.27 KB (0%)
1. entry point: @reduxjs/toolkit/query (cjs.production.min.js) 20.63 KB (+0.49% 🔺)
1. entry point: @reduxjs/toolkit/query (esm.js) 17.64 KB (+0.65% 🔺)
1. entry point: @reduxjs/toolkit/query/react (cjs.production.min.js) 22.7 KB (+0.43% 🔺)
1. entry point: @reduxjs/toolkit/query/react (esm.js) 20.26 KB (+0.58% 🔺)
2. entry point: @reduxjs/toolkit (without dependencies) (cjs.production.min.js) 5.6 KB (0%)
2. entry point: @reduxjs/toolkit (without dependencies) (esm.js) 5.58 KB (0%)
2. entry point: @reduxjs/toolkit/query (without dependencies) (cjs.production.min.js) 9.42 KB (+1.05% 🔺)
2. entry point: @reduxjs/toolkit/query (without dependencies) (esm.js) 9.8 KB (+1.12% 🔺)
2. entry point: @reduxjs/toolkit/query/react (without dependencies) (cjs.production.min.js) 2.6 KB (0%)
2. entry point: @reduxjs/toolkit/query/react (without dependencies) (esm.js) 2.44 KB (0%)
3. createSlice (esm.js) 5.16 KB (0%)
3. createEntityAdapter (esm.js) 5.83 KB (0%)
3. configureStore (esm.js) 5.83 KB (0%)
3. createApi (esm.js) 15.89 KB (+0.54% 🔺)
3. createApi (react) (esm.js) 18.47 KB (+0.52% 🔺)
3. fetchBaseQuery (esm.js) 11.03 KB (+0.32% 🔺)
3. setupListeners (esm.js) 9.85 KB (0%)
3. ApiProvider (esm.js) 17.31 KB (+0.56% 🔺)

@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 28, 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 09e4306:

Sandbox Source
Vanilla Configuration
Vanilla Typescript Configuration
rsk-github-issues-example Configuration

@@ -71,36 +72,27 @@ const authSlice = createSlice({
const storeRef = setupApiStore(api, { auth: authSlice.reducer })
type RootState = ReturnType<typeof storeRef.store.getState>

const defaultBaseQueryApi: BaseQueryApi = {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be a callback, as otherwise all tests will refer storeRef.store from before the first test as the stale reference will not pick up the store replacement between tests.

@phryneas phryneas added this to the 1.7 milestone Oct 28, 2021
@phryneas phryneas merged commit ae94709 into v1.7.0-integration Oct 28, 2021
@phryneas phryneas deleted the baseQuery-info branch October 28, 2021 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Implemented
Development

Successfully merging this pull request may close these issues.

2 participants