MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / useSubscribeToAllClusters

Function useSubscribeToAllClusters

console/src/store/allClusters.ts:29–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27});
28
29export function useSubscribeToAllClusters() {
30 const subscribe = React.useMemo(() => {
31 return buildSubscribeQuery(
32 buildClustersQuery({ queryOwnership: false, includeSystemObjects: true }),
33 {
34 upsertKey: "id",
35 },
36 );
37 }, []);
38
39 return useGlobalUpsertSubscribe({
40 atom: allClusters,
41 subscribe,
42 select: (row) => row.data,
43 upsertKey: (row) => row.data.id,
44 });
45}
46
47export function useAllClusters() {
48 const result = useAtomValue(allClusters);

Callers 1

useAppInitializerFunction · 0.90

Calls 3

buildClustersQueryFunction · 0.90
useGlobalUpsertSubscribeFunction · 0.90
buildSubscribeQueryFunction · 0.85

Tested by

no test coverage detected