Function
useMergedCommands
(
initialCommands: Command[],
mcpCommands: Command[],
)
Source from the content-addressed store, hash-verified
| 3 | import type { Command } from '../commands.js' |
| 4 | |
| 5 | export 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 | |
Tested by
no test coverage detected