Skip to content

Commit

Permalink
remove cicular reference
Browse files Browse the repository at this point in the history
  • Loading branch information
promer94 committed Jul 21, 2023
1 parent 97722e1 commit 6a39688
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 1 addition & 3 deletions _internal/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type * as revalidateEvents from './constants'
import type { defaultConfig } from './utils/config'

export type GlobalState = [
Record<string, RevalidateCallback[]>, // EVENT_REVALIDATORS
Expand Down Expand Up @@ -293,8 +292,7 @@ export type Middleware = (
) => <Data = any, Error = any>(
key: Key,
fetcher: BareFetcher<Data> | null,
config: typeof defaultConfig &
SWRConfiguration<Data, Error, BareFetcher<Data>>
config: SWRConfiguration<Data, Error, BareFetcher<Data>>
) => SWRResponse<Data, Error>

type ArgumentsTuple = [any, ...unknown[]] | readonly [any, ...unknown[]]
Expand Down
3 changes: 2 additions & 1 deletion core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import 'client-only'
import useSWR from './use-swr'
export default useSWR
// Core APIs
export { SWRConfig, unstable_serialize } from './use-swr'
export { SWRConfig } from './use-swr'
export { unstable_serialize } from './serialize'
export { useSWRConfig } from 'swr/_internal'
export { mutate } from 'swr/_internal'
export { preload } from 'swr/_internal'
Expand Down
2 changes: 1 addition & 1 deletion core/src/serialize.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Key } from 'swr'
import type { Key } from 'swr/_internal'
import { serialize } from 'swr/_internal'

export const unstable_serialize = (key: Key) => serialize(key)[0]

0 comments on commit 6a39688

Please sign in to comment.