mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-24 18:22:38 +00:00
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.
27 lines
870 B
TypeScript
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>
|
|
);
|
|
}
|