Skip to content

Commit

Permalink
quasar: Add ObservableMap empty delta detection
Browse files Browse the repository at this point in the history
Co-authored-by: Jan Beinke <[email protected]>
  • Loading branch information
queezle42 and thelegy committed Jul 3, 2024
1 parent 5dbafa2 commit a3e252d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion quasar/src/Quasar/Observable/Map.hs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,12 @@ applyOperations ops old =
instance Ord k => ObservableContainer (Map k) v where
type ContainerConstraint canLoad exceptions (Map k) v a = IsObservableMap canLoad exceptions k v a
type Delta (Map k) = (MapDelta k)
applyDelta (MapDelta ops) old = Just (applyOperations ops old)
applyDelta (MapDelta ops) old
| Map.null ops = Nothing
| otherwise = Just (applyOperations ops old)
validateDelta () delta@(MapDelta ops)
| Map.null ops = Nothing
| otherwise = Just delta
mergeDelta (MapDelta old) (MapDelta new) = MapDelta (Map.union new old)

instance ContainerCount (Map k) where
Expand Down

0 comments on commit a3e252d

Please sign in to comment.