aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/obj-multiplex.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-06-22 04:18:32 +0800
committerDan Finlay <dan@danfinlay.com>2016-06-22 04:18:32 +0800
commita08c3bc01b11fbd0e3a243359befbe9fc909edf4 (patch)
treeb79b7324139945c429ca4b6c74715d8040fdf4e1 /app/scripts/lib/obj-multiplex.js
parentf7f8f8b1c50be39db22a7b10c6c6db007fe590aa (diff)
downloadtangerine-wallet-browser-a08c3bc01b11fbd0e3a243359befbe9fc909edf4.tar
tangerine-wallet-browser-a08c3bc01b11fbd0e3a243359befbe9fc909edf4.tar.gz
tangerine-wallet-browser-a08c3bc01b11fbd0e3a243359befbe9fc909edf4.tar.bz2
tangerine-wallet-browser-a08c3bc01b11fbd0e3a243359befbe9fc909edf4.tar.lz
tangerine-wallet-browser-a08c3bc01b11fbd0e3a243359befbe9fc909edf4.tar.xz
tangerine-wallet-browser-a08c3bc01b11fbd0e3a243359befbe9fc909edf4.tar.zst
tangerine-wallet-browser-a08c3bc01b11fbd0e3a243359befbe9fc909edf4.zip
Auto linted
Diffstat (limited to 'app/scripts/lib/obj-multiplex.js')
-rw-r--r--app/scripts/lib/obj-multiplex.js13
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')
})
}