Skip to content

Commit

Permalink
breaking: drop legacy types (vercel#1930)
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi authored and himanshiLt committed Apr 26, 2022
1 parent dd690b1 commit b90d715
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
6 changes: 0 additions & 6 deletions infinite/index.ts
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
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
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

0 comments on commit b90d715

Please sign in to comment.