eslint: Fix unicorn/no-array-for-each.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2021-01-22 13:29:08 -08:00
committed by Tim Abbott
parent aa7df21265
commit 552f4e3d22
41 changed files with 190 additions and 181 deletions

View File

@@ -235,7 +235,7 @@ function insert_hotspot_into_DOM(hotspot) {
}
// reposition on any event that might update the UI
["resize", "scroll", "onkeydown", "click"].forEach((event_name) => {
for (const event_name of ["resize", "scroll", "onkeydown", "click"]) {
window.addEventListener(
event_name,
_.debounce(() => {
@@ -245,7 +245,7 @@ function insert_hotspot_into_DOM(hotspot) {
}, 10),
true,
);
});
}
}, hotspot.delay * 1000);
}
@@ -278,10 +278,10 @@ function close_read_hotspots(new_hotspots) {
exports.load_new = function (new_hotspots) {
close_read_hotspots(new_hotspots);
new_hotspots.forEach((hotspot) => {
for (const hotspot of new_hotspots) {
hotspot.location = HOTSPOT_LOCATIONS.get(hotspot.name);
});
new_hotspots.forEach(insert_hotspot_into_DOM);
insert_hotspot_into_DOM(hotspot);
}
};
exports.initialize = function () {