Skip to content

Commit

Permalink
chore: rename to barefetcher
Browse files Browse the repository at this point in the history
  • Loading branch information
promer94 committed Nov 22, 2021
1 parent ede734b commit 62f5a5c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions infinite/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SWRConfiguration, SWRResponse, Arguments, OriginFetcher } from 'swr'
import { SWRConfiguration, SWRResponse, Arguments, BareFetcher } from 'swr'

type FetcherResponse<Data = unknown> = Data | Promise<Data>

Expand Down Expand Up @@ -64,15 +64,15 @@ export interface SWRInfiniteHook {
): SWRInfiniteResponse<Data, Error>
<Data = any, Error = any>(
getKey: InfiniteKeyLoader<Arguments>,
fetcher: OriginFetcher<Data> | null
fetcher: BareFetcher<Data> | null
): SWRInfiniteResponse<Data, Error>
<Data = any, Error = any>(
getKey: InfiniteKeyLoader<Arguments>,
config: SWRInfiniteConfiguration<Data, Error, Arguments> | undefined
): SWRInfiniteResponse<Data, Error>
<Data = any, Error = any>(
getKey: InfiniteKeyLoader<Arguments>,
fetcher: OriginFetcher<Data> | null,
fetcher: BareFetcher<Data> | null,
config: SWRInfiniteConfiguration<Data, Error, Arguments> | undefined
): SWRInfiniteResponse<Data, Error>
}
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export {
SWRResponse,
Cache,
SWRHook,
OriginFetcher,
BareFetcher,
Fetcher,
MutatorCallback,
Middleware,
Expand Down
10 changes: 5 additions & 5 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as revalidateEvents from './constants/revalidate-events'

export type FetcherResponse<Data = unknown> = Data | Promise<Data>
export type OriginFetcher<Data = unknown> = (
export type BareFetcher<Data = unknown> = (
...args: any[]
) => FetcherResponse<Data>
export type Fetcher<
Expand Down Expand Up @@ -118,25 +118,25 @@ export interface SWRHook {
<Data = any, Error = any>(key: Key): SWRResponse<Data, Error>
<Data = any, Error = any>(
key: Key,
fetcher: OriginFetcher<Data> | null
fetcher: BareFetcher<Data> | null
): SWRResponse<Data, Error>
<Data = any, Error = any>(
key: Key,
config: SWRConfiguration<Data, Error> | undefined
): SWRResponse<Data, Error>
<Data = any, Error = any>(
key: Key,
fetcher: OriginFetcher<Data>,
fetcher: BareFetcher<Data>,
config: SWRConfiguration<Data, Error> | undefined
): SWRResponse<Data, Error>
<Data = any, Error = any>(
...args:
| [Key]
| [Key, OriginFetcher<Data> | null]
| [Key, BareFetcher<Data> | null]
| [Key, SWRConfiguration<Data, Error> | undefined]
| [
Key,
OriginFetcher<Data> | null,
BareFetcher<Data> | null,
SWRConfiguration<Data, Error> | undefined
]
): SWRResponse<Data, Error>
Expand Down

0 comments on commit 62f5a5c

Please sign in to comment.