Skip to main content
Glama

Storyden

by Southclaws
Mozilla Public License 2.0
229
events.ts916 B
import mitt from "mitt"; import { useEffect } from "react"; import { LibraryPageBlockType } from "./metadata"; export type LibraryBlockEvents = { "library:reorder-block": { activeId: LibraryPageBlockType; overId: LibraryPageBlockType; }; "library:add-block": { type: LibraryPageBlockType; index?: number }; "library:remove-block": { type: LibraryPageBlockType }; }; export const libraryBus = mitt<LibraryBlockEvents>(); export function useLibraryBlockEvent<K extends keyof LibraryBlockEvents>( type: K, handler: (event: LibraryBlockEvents[K]) => void, ) { useEffect(() => { libraryBus.on(type, handler); return () => { libraryBus.off(type, handler); }; }, [type, handler]); } export function useEmitLibraryBlockEvent() { return <K extends keyof LibraryBlockEvents>( type: K, payload: LibraryBlockEvents[K], ) => { libraryBus.emit(type, payload); }; }

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/Southclaws/storyden'

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