-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes an issue (#18) with extending config, refactoring of code
- Loading branch information
Showing
6 changed files
with
164 additions
and
135 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
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
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
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,31 +1,31 @@ | ||
export { AwaitLoader } from "./AwaitLoader"; | ||
export { RTKLoader } from "./RTKLoader"; | ||
export { aggregateToQuery } from "./aggregateToQuery"; | ||
export { createLoader, createUseLoader } from "./createLoader"; | ||
export { useCreateQuery } from "./createQuery"; | ||
export { RTKLoader } from "./RTKLoader"; | ||
export type { | ||
Component, | ||
ComponentWithLoaderData, | ||
ConsumerProps, | ||
CreateUseLoaderArgs, | ||
CreateLoaderArgs, | ||
DeferredConfig, | ||
LoaderConfig, | ||
_TDeferred, | ||
_TPayload, | ||
_TQueries, | ||
_TProps, | ||
_TReturn, | ||
MakeDataRequired, | ||
CreateUseLoaderArgs, | ||
CustomLoaderProps, | ||
DataShapeInput, | ||
DeferredConfig, | ||
InferLoaderData, | ||
Loader, | ||
LoaderConfig, | ||
LoaderTransformFunction, | ||
MakeDataRequired, | ||
OptionalGenericArg, | ||
UseLoader, | ||
UseQueryResult, | ||
WithLoaderArgs, | ||
_TDeferred, | ||
_TPayload, | ||
_TProps, | ||
_TQueries, | ||
_TReturn, | ||
} from "./types"; | ||
export { withLoader } from "./withLoader"; | ||
export { AwaitLoader } from "./AwaitLoader"; | ||
export { useCreateLoader } from "./useCreateLoader"; | ||
export { withLoader } from "./withLoader"; |
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,38 @@ | ||
import React from "react"; | ||
|
||
export class ErrorBoundary extends React.Component< | ||
{ | ||
children?: React.ReactNode; | ||
fallback?: React.ReactNode; | ||
}, | ||
{ | ||
hasError: boolean; | ||
} | ||
> { | ||
public state = { | ||
hasError: false, | ||
}; | ||
|
||
public static getDerivedStateFromError(_: Error) { | ||
return { hasError: true }; | ||
} | ||
|
||
public componentDidCatch( | ||
error: Error, | ||
errorInfo: React.ErrorInfo | ||
) { | ||
console.error("Uncaught error:", error, errorInfo); | ||
} | ||
|
||
public render() { | ||
if (this.state.hasError) { | ||
return ( | ||
<h1>{this.props.fallback ?? "_error_boundary_"}</h1> | ||
); | ||
} | ||
|
||
return this.props.children; | ||
} | ||
} | ||
|
||
export default ErrorBoundary; |
Oops, something went wrong.