diff options
author | Whymarrh Whitby <whymarrh.whitby@gmail.com> | 2019-02-12 22:05:30 +0800 |
---|---|---|
committer | Whymarrh Whitby <whymarrh.whitby@gmail.com> | 2019-02-12 22:06:15 +0800 |
commit | 92cc60f425e33fd3de31efd004e5144cb270b924 (patch) | |
tree | f6294614c73e65b06dbbf3c267e5de5819fb3dda /app | |
parent | ade96fda413b265d9c5eb5329c7c644908514f6e (diff) | |
download | tangerine-wallet-browser-92cc60f425e33fd3de31efd004e5144cb270b924.tar tangerine-wallet-browser-92cc60f425e33fd3de31efd004e5144cb270b924.tar.gz tangerine-wallet-browser-92cc60f425e33fd3de31efd004e5144cb270b924.tar.bz2 tangerine-wallet-browser-92cc60f425e33fd3de31efd004e5144cb270b924.tar.lz tangerine-wallet-browser-92cc60f425e33fd3de31efd004e5144cb270b924.tar.xz tangerine-wallet-browser-92cc60f425e33fd3de31efd004e5144cb270b924.tar.zst tangerine-wallet-browser-92cc60f425e33fd3de31efd004e5144cb270b924.zip |
Update popup-core script to use ES6 destructuring, const, let
Diffstat (limited to 'app')
-rw-r--r-- | app/scripts/popup-core.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/app/scripts/popup-core.js b/app/scripts/popup-core.js index db885ec93..e964d001d 100644 --- a/app/scripts/popup-core.js +++ b/app/scripts/popup-core.js @@ -1,11 +1,11 @@ -const EventEmitter = require('events').EventEmitter +const {EventEmitter} = require('events') const async = require('async') const Dnode = require('dnode') const Eth = require('ethjs') const EthQuery = require('eth-query') const launchMetamaskUi = require('../../ui') const StreamProvider = require('web3-stream-provider') -const setupMultiplex = require('./lib/stream-utils.js').setupMultiplex +const {setupMultiplex} = require('./lib/stream-utils.js') module.exports = initializePopup @@ -32,7 +32,7 @@ function initializePopup ({ container, connectionStream }, cb) { function connectToAccountManager (connectionStream, cb) { // setup communication with background // setup multiplexing - var mx = setupMultiplex(connectionStream) + const mx = setupMultiplex(connectionStream) // connect features setupControllerConnection(mx.createStream('controller'), cb) setupWeb3Connection(mx.createStream('provider')) @@ -44,7 +44,7 @@ function connectToAccountManager (connectionStream, cb) { * @param {PortDuplexStream} connectionStream PortStream instance establishing a background connection */ function setupWeb3Connection (connectionStream) { - var providerStream = new StreamProvider() + const providerStream = new StreamProvider() providerStream.pipe(connectionStream).pipe(providerStream) connectionStream.on('error', console.error.bind(console)) providerStream.on('error', console.error.bind(console)) @@ -62,8 +62,8 @@ function setupWeb3Connection (connectionStream) { function setupControllerConnection (connectionStream, cb) { // this is a really sneaky way of adding EventEmitter api // to a bi-directional dnode instance - var eventEmitter = new EventEmitter() - var accountManagerDnode = Dnode({ + const eventEmitter = new EventEmitter() + const accountManagerDnode = Dnode({ sendUpdate: function (state) { eventEmitter.emit('update', state) }, |