MCPcopy Create free account
hub / github.com/Effect-TS/effect / closeTree

Function closeTree

packages/effect/src/ui/kit/Menu.ts:1052–1070  ·  view source on GitHub ↗
(
  model: MenuModel,
  $: MenuUpdate,
  reason: MenuChangeReason,
  method: MenuInteraction | null,
  first?: MenuEvents
)

Source from the content-addressed store, hash-verified

1050}
1051
1052const closeTree = (
1053 model: MenuModel,
1054 $: MenuUpdate,
1055 reason: MenuChangeReason,
1056 method: MenuInteraction | null,
1057 first?: MenuEvents
1058) => {
1059 const base: Base = parentOf($) === undefined
1060 ? $
1061 : $.send("self", MenuMessage.RequestedCloseByChild({ reason }))
1062 return dismiss(
1063 model,
1064 $,
1065 reason,
1066 method,
1067 false,
1068 first === undefined ? base : base.emit(first)
1069 )
1070}
1071
1072const isSubmenu = (model: MenuModel, value: string): boolean => model.submenus.some((submenu) => submenu.item === value)
1073

Callers 3

activateFunction · 0.85
pressKeyFunction · 0.85
Menu.tsFile · 0.85

Calls 4

parentOfFunction · 0.70
dismissFunction · 0.70
sendMethod · 0.65
emitMethod · 0.65

Tested by

no test coverage detected