DEV: removes _.reduce from codebase (#6628)

DEV: removes _.reduce from codebase (#6628)

From 86dafc1f25b95c926bf515cbc0b58e3efdbfe360 Mon Sep 17 00:00:00 2001
From: Joffrey JAFFEUX <j.jaffeux@gmail.com>
Date: Mon, 19 Nov 2018 13:04:57 +0100
Subject: [PATCH] DEV: removes _.reduce from codebase (#6628)


diff --git a/app/assets/javascripts/admin/models/report.js.es6 b/app/assets/javascripts/admin/models/report.js.es6
index 2bd9485..5e1829f 100644
--- a/app/assets/javascripts/admin/models/report.js.es6
+++ b/app/assets/javascripts/admin/models/report.js.es6
@@ -116,7 +116,7 @@ const Report = Discourse.Model.extend({
 
   @computed("data")
   currentTotal(data) {
-    return _.reduce(data, (cur, pair) => cur + pair.y, 0);
+    return data.reduce((cur, pair) => cur + pair.y, 0);
   },
 
   @computed("data", "currentTotal")

GitHub

1 Like