on develop help sign in
For listWithKeyShallowDiff, don't re-send initial values
commitf78a73ef7300846f4b81f34df0d17d75cb64476d authorRyan Trinkle <ryan.trinkle@gmail.com> dateSun 10 Dec 2017, 21:29 (9 years ago) parent5add413
1 file changed+1−1
src/Reflex/Collection.hs+1−1
src/Reflex/Collection.hs+1−1
@@ -74,7 +74,7 @@ listWithKey' = listWithKeyShallowDiff
7474listWithKeyShallowDiff :: (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))
7575listWithKeyShallowDiff initialVals valsChanged mkChild = do
7676 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
7878 let relevantPatch patch _ = case patch of
7979 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
8080 Just _ -> Nothing -- We don't want to let spurious re-creations of items through