Skip to content

Commit

Permalink
Simplify.
Browse files Browse the repository at this point in the history
  • Loading branch information
justinkambic committed Jun 6, 2024
1 parent 02f5d08 commit 6d4c1c9
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,14 @@ export function createStatusTimeBins(
pingStatuses: MonitorStatusHeatmap[]
): MonitorStatusTimeBin[] {
return timeBuckets.map(({ start, end }) => {
const { up: ups, down: downs } = pingStatuses
const { ups, downs } = pingStatuses
.filter(({ key }) => key >= start && key <= end)
.reduce(
(acc, cur) => ({
up: acc.up + cur.up.value,
down: acc.down + cur.down.value,
ups: acc.ups + cur.up.value,
downs: acc.downs + cur.down.value,
}),
{ up: 0, down: 0 }
{ ups: 0, downs: 0 }
);
return {
start,
Expand Down

0 comments on commit 6d4c1c9

Please sign in to comment.