diff options
author | kumavis <kumavis@users.noreply.github.com> | 2016-06-22 05:24:28 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-22 05:24:28 +0800 |
commit | 537328b5298a42f9d20862d42b9012babcda373c (patch) | |
tree | 9a5728447f5b23a918b4a23c12e91ea1b702e527 /app/scripts/lib/obj-multiplex.js | |
parent | bb7788373d9c234313d651d88c72c18a8e4ca0aa (diff) | |
parent | d7c3e8e9f5182576eb4a990d385ff8ce4ebd417c (diff) | |
download | tangerine-wallet-browser-537328b5298a42f9d20862d42b9012babcda373c.tar tangerine-wallet-browser-537328b5298a42f9d20862d42b9012babcda373c.tar.gz tangerine-wallet-browser-537328b5298a42f9d20862d42b9012babcda373c.tar.bz2 tangerine-wallet-browser-537328b5298a42f9d20862d42b9012babcda373c.tar.lz tangerine-wallet-browser-537328b5298a42f9d20862d42b9012babcda373c.tar.xz tangerine-wallet-browser-537328b5298a42f9d20862d42b9012babcda373c.tar.zst tangerine-wallet-browser-537328b5298a42f9d20862d42b9012babcda373c.zip |
Merge pull request #303 from MetaMask/AutoLint
Auto lint
Diffstat (limited to 'app/scripts/lib/obj-multiplex.js')
-rw-r--r-- | app/scripts/lib/obj-multiplex.js | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/app/scripts/lib/obj-multiplex.js b/app/scripts/lib/obj-multiplex.js index ad1d914f8..f54ff7653 100644 --- a/app/scripts/lib/obj-multiplex.js +++ b/app/scripts/lib/obj-multiplex.js @@ -2,11 +2,10 @@ const through = require('through2') module.exports = ObjectMultiplex - -function ObjectMultiplex(opts){ +function ObjectMultiplex (opts) { opts = opts || {} // create multiplexer - var mx = through.obj(function(chunk, enc, cb) { + var mx = through.obj(function (chunk, enc, cb) { var name = chunk.name var data = chunk.data var substream = mx.streams[name] @@ -19,19 +18,19 @@ function ObjectMultiplex(opts){ }) mx.streams = {} // create substreams - mx.createStream = function(name) { - var substream = mx.streams[name] = through.obj(function(chunk, enc, cb) { + mx.createStream = function (name) { + var substream = mx.streams[name] = through.obj(function (chunk, enc, cb) { mx.push({ name: name, data: chunk, }) return cb() }) - mx.on('end', function() { + mx.on('end', function () { return substream.emit('end') }) if (opts.error) { - mx.on('error', function() { + mx.on('error', function () { return substream.emit('error') }) } |