new react-openapi
This commit is contained in:
@@ -9,9 +9,10 @@ import { SseConnectionStatus } from "./SseConnectionStatus";
|
||||
|
||||
interface SseStreamViewProps {
|
||||
resource: ResourceConfig;
|
||||
pathParams?: Record<string, string | number>;
|
||||
}
|
||||
|
||||
export function SseStreamView({ resource }: SseStreamViewProps) {
|
||||
export function SseStreamView({ resource, pathParams }: SseStreamViewProps) {
|
||||
const { stream } = useResource(resource.name);
|
||||
const [events, setEvents] = useState<any[]>(() => readSseCache(resource.name));
|
||||
const [snackbarOpen, setSnackbarOpen] = useState(false);
|
||||
@@ -31,7 +32,7 @@ export function SseStreamView({ resource }: SseStreamViewProps) {
|
||||
},
|
||||
onOpen: () => setSseConnected(resource.name, true),
|
||||
onError: () => setSseConnected(resource.name, false),
|
||||
});
|
||||
}, pathParams);
|
||||
|
||||
return () => {
|
||||
setSseConnected(resource.name, false);
|
||||
|
||||
Reference in New Issue
Block a user