-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add isFetchError type guard (#41)
- Loading branch information
1 parent
7bb5e01
commit 111a48f
Showing
2 changed files
with
8 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { FetchError } from './lib/fetch-error'; | ||
|
||
export function isFetchError(error: any): error is FetchError { | ||
return error instanceof FetchError; | ||
} | ||
|
||
export { FetchError }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
// NOTE: do NOT export `Form` here. Next.js can't properly tree shake the client | ||
// bundle if there are client & server imports in a single import statement. | ||
export * from './errors'; | ||
export * from './handle'; | ||
export * from './responses'; |