Files
paseo/packages/app/src/plugins/runtime-boundary.tsx
T
Mohamed Boudra 6f2195904b fix(subscriptions): isolate observers and silence unrequested feeds (#4596)
Give each observation a server-issued ID owned by its physical connection. Preserve snapshot-only reads and combined list-and-subscribe, source-bound replies, lifecycle cleanup and legacy wire compatibility.
2026-09-11 08:07:35 +02:00

27 lines
870 B
TypeScript

import { QueryClientProvider } from "@tanstack/react-query";
import { PaseoApiProvider, PluginRpcProvider } from "@getpaseo/plugin/client/host";
import type { ReactNode } from "react";
import type { InstalledPlugin } from "./types";
import { usePluginSurfaceRuntime } from "./surface-runtime";
import type { DaemonClient } from "@getpaseo/client/internal/daemon-client";
export function PluginRuntimeBoundary({
plugin,
client,
children,
}: {
plugin: InstalledPlugin;
client: DaemonClient;
children: ReactNode;
}) {
const runtime = usePluginSurfaceRuntime(client, plugin);
if (!runtime) return null;
return (
<QueryClientProvider client={plugin.queryClient}>
<PaseoApiProvider paseo={runtime.paseo}>
<PluginRpcProvider invoke={runtime.invoke}>{children}</PluginRpcProvider>
</PaseoApiProvider>
</QueryClientProvider>
);
}