Electron-104 - Optimized async dependency in electron-notify

This commit is contained in:
Kiran Niranjan 2017-08-04 11:58:06 +05:30 committed by Kiran Niranjan
parent 3b46d2e76d
commit 2e943359bb
2 changed files with 10 additions and 8 deletions

View File

@ -10,8 +10,9 @@
// //
const path = require('path'); const path = require('path');
const fs = require('fs'); const fs = require('fs');
const async = require('async');
const electron = require('electron'); const electron = require('electron');
const asyncMap = require('async.map');
const asyncMapSeries = require('async.mapseries');
const app = electron.app; const app = electron.app;
const BrowserWindow = electron.BrowserWindow; const BrowserWindow = electron.BrowserWindow;
const ipc = electron.ipcMain; const ipc = electron.ipcMain;
@ -541,9 +542,9 @@ function moveOneDown(startPos) {
notificationPosArray.push(i) notificationPosArray.push(i)
} }
// Start to animate all notifications at once or in parallel // Start to animate all notifications at once or in parallel
let asyncFunc = async.map // Best performance let asyncFunc = asyncMap // Best performance
if (config.animateInParallel === false) { if (config.animateInParallel === false) {
asyncFunc = async.mapSeries // Sluggish asyncFunc = asyncMapSeries // Sluggish
} }
asyncFunc(notificationPosArray, moveNotificationAnimation, function() { asyncFunc(notificationPosArray, moveNotificationAnimation, function() {
resolve() resolve()

View File

@ -87,15 +87,16 @@
}, },
"dependencies": { "dependencies": {
"@paulcbetts/system-idle-time": "^1.0.4", "@paulcbetts/system-idle-time": "^1.0.4",
"async": "^2.1.5", "appdirectory": "^0.1.0",
"async.map": "^0.5.2",
"async.mapseries": "^0.5.2",
"auto-launch": "^5.0.1", "auto-launch": "^5.0.1",
"electron-context-menu": "^0.8.0", "electron-context-menu": "^0.8.0",
"electron-squirrel-startup": "^1.0.0",
"keymirror": "0.1.1",
"winreg": "^1.2.3",
"electron-dl": "^1.9.0", "electron-dl": "^1.9.0",
"electron-squirrel-startup": "^1.0.0",
"filesize": "^3.5.10", "filesize": "^3.5.10",
"appdirectory": "^0.1.0" "keymirror": "0.1.1",
"winreg": "^1.2.3"
}, },
"optionalDependencies": { "optionalDependencies": {
"screen-snippet": "git+https://github.com/symphonyoss/ScreenSnippet.git#v1.0.1" "screen-snippet": "git+https://github.com/symphonyoss/ScreenSnippet.git#v1.0.1"