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

types: drop legacy types #1930

Merged
merged 1 commit into from
Apr 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions infinite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,3 @@ export {
SWRInfiniteKeyLoader,
SWRInfiniteFetcher
}

// @TODO: remove this in 2.0
/**
* @deprecated `InfiniteFetcher` will be renamed to `SWRInfiniteFetcher`.
*/
export type InfiniteFetcher = SWRInfiniteFetcher
5 changes: 1 addition & 4 deletions test/unit/web-preset.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,7 @@ function runTests(propertyName) {
const release = initFocus(fn) as () => void
const target = global[propertyName]

// TODO: target?.emit?() breaks prettier, fix prettier format
if (target && target.emit) {
target.emit(eventName)
}
target?.emit?.(eventName)

expect(fn).toBeCalledTimes(0)

Expand Down
5 changes: 2 additions & 3 deletions test/use-swr-local-mutation.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1242,9 +1242,8 @@ describe('useSWR - local mutation', () => {

let appendData

const sendRequest = newItem => {
// @TODO: We use `any` here due to limitation of type inference.
return new Promise<any>(res =>
const sendRequest = <Data,>(newItem) => {
return new Promise<Data>(res =>
setTimeout(() => {
// Server capitializes the new item.
const modifiedData =
Expand Down