@@ -74,7 +74,7 @@ listWithKey' = listWithKeyShallowDiff
74listWithKeyShallowDiff :: (Ord k, Adjustable t m, MonadFix m, MonadHold t m) => Map k v -> Event t (Map k (Maybe v)) -> (k -> v -> Event t v -> m a) -> m (Dynamic t (Map k a))
74listWithKeyShallowDiff :: (Ord k, Adjustable t m, MonadFix m, MonadHold t m) => Map k v -> Event t (Map k (Maybe v)) -> (k -> v -> Event t v -> m a) -> m (Dynamic t (Map k a))
75listWithKeyShallowDiff initialVals valsChanged mkChild = do
75listWithKeyShallowDiff initialVals valsChanged mkChild = do
76 let childValChangedSelector = fanMap $ fmap (Map.mapMaybe id) valsChanged
76 let childValChangedSelector = fanMap $ fmap (Map.mapMaybe id) valsChanged
77− sentVals <- foldDyn applyMap Map.empty $ fmap (fmap void) valsChanged
77+ sentVals <- foldDyn applyMap (void initialVals) $ fmap (fmap void) valsChanged
78 let relevantPatch patch _ = case patch of
78 let relevantPatch patch _ = case patch of
79 Nothing -> Just Nothing -- Even if we let a Nothing through when the element doesn't already exist, this doesn't cause a problem because it is ignored
79 Nothing -> Just Nothing -- Even if we let a Nothing through when the element doesn't already exist, this doesn't cause a problem because it is ignored
80 Just _ -> Nothing -- We don't want to let spurious re-creations of items through
80 Just _ -> Nothing -- We don't want to let spurious re-creations of items through