Function
closeTree
(
model: MenuModel,
$: MenuUpdate,
reason: MenuChangeReason,
method: MenuInteraction | null,
first?: MenuEvents
)
Source from the content-addressed store, hash-verified
| 1050 | } |
| 1051 | |
| 1052 | const 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 | |
| 1072 | const isSubmenu = (model: MenuModel, value: string): boolean => model.submenus.some((submenu) => submenu.item === value) |
| 1073 | |
Tested by
no test coverage detected