Destructure objects

This commit is contained in:
Kevin Sawicki 2016-03-21 11:09:29 -07:00
parent 4127b524d5
commit 2d32956903
2 changed files with 6 additions and 4 deletions

View file

@ -1,3 +1,5 @@
'use strict';
const ipcMain = require('electron').ipcMain;
const desktopCapturer = process.atomBinding('desktop_capturer').desktopCapturer;
@ -33,7 +35,7 @@ ipcMain.on('ATOM_BROWSER_DESKTOP_CAPTURER_GET_SOURCES', function(event, captureW
desktopCapturer.emit = function(event, name, sources) {
// Receiving sources result from main process, now send them back to renderer.
var captureScreen, captureWindow, handledRequest, i, len, ref, ref1, ref2, request, result, source, thumbnailSize, unhandledRequestsQueue;
var handledRequest, i, len, ref, ref1, request, result, source, unhandledRequestsQueue;
handledRequest = requestsQueue.shift(0);
result = (function() {
var i, len, results;
@ -69,7 +71,7 @@ desktopCapturer.emit = function(event, name, sources) {
// If the requestsQueue is not empty, start a new request handling.
if (requestsQueue.length > 0) {
ref2 = requestsQueue[0].options, captureWindow = ref2.captureWindow, captureScreen = ref2.captureScreen, thumbnailSize = ref2.thumbnailSize;
const {captureWindow, captureScreen, thumbnailSize} = requestsQueue[0].options;
return desktopCapturer.startHandling(captureWindow, captureScreen, thumbnailSize);
}
};