MCPcopy Create free account
hub / github.com/codeaashu/claude-code / useMergedCommands

Function useMergedCommands

src/hooks/useMergedCommands.ts:5–15  ·  view source on GitHub ↗
(
  initialCommands: Command[],
  mcpCommands: Command[],
)

Source from the content-addressed store, hash-verified

3import type { Command } from '../commands.js'
4
5export function useMergedCommands(
6 initialCommands: Command[],
7 mcpCommands: Command[],
8): Command[] {
9 return useMemo(() => {
10 if (mcpCommands.length > 0) {
11 return uniqBy([...initialCommands, ...mcpCommands], 'name')
12 }
13 return initialCommands
14 }, [initialCommands, mcpCommands])
15}
16

Callers 1

REPLFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected