Skip to content

Commit

Permalink
re-export InfiniteFetcher (vercel#1728)
Browse files Browse the repository at this point in the history
  • Loading branch information
shuding authored and nevilm-lt committed Apr 22, 2022
1 parent 385cc01 commit 0112c5b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion infinite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import { useIsomorphicLayoutEffect } from '../src/utils/env'
import { serialize } from '../src/utils/serialize'
import { isUndefined, isFunction, UNDEFINED } from '../src/utils/helper'
import { withMiddleware } from '../src/utils/with-middleware'
import {

import type {
SWRInfiniteConfiguration,
SWRInfiniteResponse,
SWRInfiniteHook,
Expand Down Expand Up @@ -265,10 +266,17 @@ export const infinite = (<Data, Error>(useSWRNext: SWRHook) =>
}) as unknown as Middleware

export default withMiddleware(useSWR, infinite) as SWRInfiniteHook

export {
SWRInfiniteConfiguration,
SWRInfiniteResponse,
SWRInfiniteHook,
SWRInfiniteKeyLoader,
SWRInfiniteFetcher
}

// @TODO: remove this in 2.0
/**
* @deprecated `InfiniteFetcher` will be renamed to `SWRInfiniteFetcher`.
*/
export type InfiniteFetcher = SWRInfiniteFetcher

0 comments on commit 0112c5b

Please sign in to comment.