From df434983ded32c76181069086bf00addc481a44a Mon Sep 17 00:00:00 2001 From: Francisco Vallarino Date: Sat, 4 Feb 2023 19:28:51 -0300 Subject: [PATCH] Minor clarification in WidgetEnv's widgetKeyMap (#255) --- src/Monomer/Core/WidgetTypes.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Monomer/Core/WidgetTypes.hs b/src/Monomer/Core/WidgetTypes.hs index 9d32f4ca..f900c446 100644 --- a/src/Monomer/Core/WidgetTypes.hs +++ b/src/Monomer/Core/WidgetTypes.hs @@ -329,10 +329,12 @@ data WidgetEnv s e = WidgetEnv { _weWidgetShared :: MVar (Map Text WidgetShared), {-| The active map of WidgetKey -> WidgetNode, if any. This map is restricted to - to the parent "Monomer.Widgets.Composite". Do not use this map directly, rely - instead on the 'Monomer.Core.Util.widgetIdFromKey', - 'Monomer.Core.Util.nodeInfoFromKey' and 'Monomer.Core.Util.nodeInfoFromPath' - utility functions. + to the parent "Monomer.Widgets.Composite". + + It is recommended to not use this map directly, since `WidgetNodeInfo` may be + stale (path and widgetId are always valid). Because of this it is safer to use + the 'Monomer.Core.Util.widgetIdFromKey', 'Monomer.Core.Util.nodeInfoFromKey' + and 'Monomer.Core.Util.nodeInfoFromPath' utility functions. -} _weWidgetKeyMap :: WidgetKeyMap s e, -- | The currently hovered path, if any.