Skip to content
This repository has been archived by the owner on Feb 26, 2021. It is now read-only.

Commit

Permalink
fix: reduce bundle size (#66)
Browse files Browse the repository at this point in the history
* fix: reduce bundle size

* chore: update deps
  • Loading branch information
hugomrdias authored and jacobheun committed Jan 10, 2019
1 parent c102915 commit 16b6339
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 23 deletions.
7 changes: 0 additions & 7 deletions .jshintrc

This file was deleted.

27 changes: 13 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,25 @@
"dependencies": {
"async": "^2.6.1",
"class-is": "^1.1.0",
"data-queue": "0.0.3",
"debug": "^4.1.1",
"interface-connection": "~0.3.3",
"libp2p-crypto": "~0.15.0",
"mafmt": "^6.0.3",
"merge-recursive": "0.0.3",
"multiaddr": "^6.0.2",
"interface-connection": "~0.3.2",
"libp2p-crypto": "~0.16.0",
"mafmt": "^6.0.4",
"multiaddr": "^6.0.3",
"nanoid": "^2.0.0",
"once": "^1.4.0",
"peer-id": "~0.12.1",
"peer-info": "~0.15.0",
"peer-id": "~0.12.2",
"peer-info": "~0.15.1",
"pull-stream": "^3.6.9",
"socket.io-client": "^2.1.1",
"socket.io-pull-stream": "~0.1.5",
"uuid": "^3.3.2"
},
"directories": {
"test": "test"
"socket.io-pull-stream": "~0.1.5"
},
"files": [
"src",
"dist"
],
"devDependencies": {
"aegir": "^18.0.2",
"aegir": "^18.0.3",
"chai": "^4.2.0",
"dirty-chai": "^2.0.1",
"libp2p-websocket-star-rendezvous": "~0.2.4",
Expand Down
5 changes: 3 additions & 2 deletions src/listener.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ const setImmediate = require('async/setImmediate')
const utils = require('./utils')
const cleanUrlSIO = utils.cleanUrlSIO
const crypto = require('libp2p-crypto')
const pull = require('pull-stream')
const pull = require('pull-stream/pull')
const through = require('pull-stream/throughs/through')
const ERRORS = require('./errors')

const noop = once(() => {})
Expand Down Expand Up @@ -296,7 +297,7 @@ class Listener extends EE {

stateWatch (sink, source) {
let cstate = { sink: true, source: true }
const watch = (name) => pull.through(v => v, e => {
const watch = (name) => through(v => v, e => {
cstate[name] = false
if (!cstate.sink && !cstate.source) {
this.maybeClose()
Expand Down

0 comments on commit 16b6339

Please sign in to comment.