Skip to content

Commit 0112c5b

Browse files
shudingnevilm-lt
authored andcommitted
re-export InfiniteFetcher (vercel#1728)
1 parent 385cc01 commit 0112c5b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

infinite/index.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ import { useIsomorphicLayoutEffect } from '../src/utils/env'
1313
import { serialize } from '../src/utils/serialize'
1414
import { isUndefined, isFunction, UNDEFINED } from '../src/utils/helper'
1515
import { withMiddleware } from '../src/utils/with-middleware'
16-
import {
16+
17+
import type {
1718
SWRInfiniteConfiguration,
1819
SWRInfiniteResponse,
1920
SWRInfiniteHook,
@@ -265,10 +266,17 @@ export const infinite = (<Data, Error>(useSWRNext: SWRHook) =>
265266
}) as unknown as Middleware
266267

267268
export default withMiddleware(useSWR, infinite) as SWRInfiniteHook
269+
268270
export {
269271
SWRInfiniteConfiguration,
270272
SWRInfiniteResponse,
271273
SWRInfiniteHook,
272274
SWRInfiniteKeyLoader,
273275
SWRInfiniteFetcher
274276
}
277+
278+
// @TODO: remove this in 2.0
279+
/**
280+
* @deprecated `InfiniteFetcher` will be renamed to `SWRInfiniteFetcher`.
281+
*/
282+
export type InfiniteFetcher = SWRInfiniteFetcher

0 commit comments

Comments
 (0)