Skip to main content
Glama
rainbow_counter.ts986 B
import { computed, ComputedRef, reactive } from "vue"; import { DefaultMap } from "@/utils/defaultmap"; import { ChangeSetId } from "@/api/sdf/dal/change_set"; const queueByChangeSet = new DefaultMap<string, Set<string>>(() => { return reactive(new Set<string>()); }); export const add = (changeSetId: string, desc: string) => { const queue = queueByChangeSet.get(changeSetId); if (queue) queue.add(desc); }; export const remove = (changeSetId: string, desc: string) => { const queue = queueByChangeSet.get(changeSetId); if (queue) queue.delete(desc); }; export const useRainbow = (changeSetId: ComputedRef<ChangeSetId>) => { return computed(() => { try { const queue = queueByChangeSet.get(changeSetId.value); /** * This is a global "stuff is happening" counter * When its > 0 the system is waiting for data */ return { count: computed(() => queue?.size ?? 0) }; } catch (err) { return { count: 0 }; } }); };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/systeminit/si'

If you have feedback or need assistance with the MCP directory API, please join our Discord server