Merges an array of incoming campaigns into the existing array, ensuring that
amount_raised and total_amount_raised never decrease (guards against
stale out-of-order data arriving from the server).
Campaigns that exist in incoming but not in existing are kept as-is.
Campaigns that exist in existing but not in incoming are preserved
unchanged.
Parameters
incoming: TiltifyCampaign[]
Fresh batch from the server.
existing: TiltifyCampaign[]
Currently-known campaigns.
Returns TiltifyCampaign[]
Merged array with monotonically non-decreasing amounts.
Merges an array of incoming campaigns into the existing array, ensuring that
amount_raisedandtotal_amount_raisednever decrease (guards against stale out-of-order data arriving from the server).Campaigns that exist in
incomingbut not inexistingare kept as-is. Campaigns that exist inexistingbut not inincomingare preserved unchanged.