app/components/ErrorDisplay: added some TODOs

This commit is contained in:
Patrik Oldsberg
2020-03-19 18:21:42 +01:00
parent bdaa6031d3
commit 392fc2a47f
@@ -23,6 +23,8 @@ import { ErrorApi, ErrorContext } from '@spotify-backstage/core';
type SubscriberFunc = (error: Error) => void;
type Unsubscribe = () => void;
// TODO: figure out where to put implementations of APIs, both inside apps
// but also in core/separate package.
export class ErrorDisplayForwarder implements ErrorApi {
private readonly subscribers = new Set<SubscriberFunc>();
@@ -47,6 +49,7 @@ type Props = {
forwarder: ErrorDisplayForwarder;
};
// TODO: improve on this and promote to a shared component for use by all apps.
const ErrorDisplay: FC<Props> = ({ forwarder }) => {
const [errors, setErrors] = useState<Array<Error>>([]);