Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 8e487da

Browse files
authored
fix: unsubscribe in series for go-ipfs (#326)
License: MIT Signed-off-by: Alan Shaw <alan@tableflip.io>
1 parent 87a8f96 commit 8e487da

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

js/src/pubsub/ls.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* eslint-env mocha */
22
'use strict'
33

4-
const each = require('async/each')
54
const eachSeries = require('async/eachSeries')
65
const { getTopic } = require('./utils')
76
const { getDescribe, getIt, expect } = require('../utils/mocha')
@@ -80,7 +79,7 @@ module.exports = (createCommon, options) => {
8079
expect(list.sort())
8180
.to.eql(topics.map((t) => t.name).sort())
8281

83-
each(topics, (t, cb) => {
82+
eachSeries(topics, (t, cb) => {
8483
ipfs.pubsub.unsubscribe(t.name, t.handler, cb)
8584
}, done)
8685
})

js/src/pubsub/unsubscribe.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-env mocha */
22
'use strict'
33

4-
const each = require('async/each')
4+
const eachSeries = require('async/eachSeries')
55
const timesSeries = require('async/timesSeries')
66
const { getTopic } = require('./utils')
77
const { getDescribe, getIt, expect } = require('../utils/mocha')
@@ -42,7 +42,7 @@ module.exports = (createCommon, options) => {
4242
ipfs.pubsub.subscribe(someTopic, handler, (err) => cb(err, handler))
4343
}, (err, handlers) => {
4444
expect(err).to.not.exist()
45-
each(
45+
eachSeries(
4646
handlers,
4747
(handler, cb) => ipfs.pubsub.unsubscribe(someTopic, handler, cb),
4848
(err) => {

0 commit comments

Comments
 (0)