diff options
author | Frankie <frankie.pangilinan@consensys.net> | 2016-06-22 06:04:00 +0800 |
---|---|---|
committer | Frankie <frankie.pangilinan@consensys.net> | 2016-06-22 06:04:00 +0800 |
commit | cf663f1104697440121d32cc6db2a8a1d5d54c5a (patch) | |
tree | 3ed4b8b9fe8c85f3b3a5bf68482c3fb9967f2de5 /app/scripts/lib/obj-multiplex.js | |
parent | 265725c6edd62a7f46a9b9cf5a443cf01f0ff00c (diff) | |
parent | dc2ef967028723afe9fe1efd669754723e38a4f0 (diff) | |
download | tangerine-wallet-browser-cf663f1104697440121d32cc6db2a8a1d5d54c5a.tar tangerine-wallet-browser-cf663f1104697440121d32cc6db2a8a1d5d54c5a.tar.gz tangerine-wallet-browser-cf663f1104697440121d32cc6db2a8a1d5d54c5a.tar.bz2 tangerine-wallet-browser-cf663f1104697440121d32cc6db2a8a1d5d54c5a.tar.lz tangerine-wallet-browser-cf663f1104697440121d32cc6db2a8a1d5d54c5a.tar.xz tangerine-wallet-browser-cf663f1104697440121d32cc6db2a8a1d5d54c5a.tar.zst tangerine-wallet-browser-cf663f1104697440121d32cc6db2a8a1d5d54c5a.zip |
Fix conflict
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') }) } |