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

Commit e6cd828

Browse files
committed
Remove WS provider once listener on next tick
1 parent 74aef21 commit e6cd828

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/web3-providers-ws/src/index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,9 @@ WebsocketProvider.prototype.once = function (type, callback) {
345345
var _this = this;
346346

347347
function onceCallback(event) {
348-
_this.removeListener(type, onceCallback);
348+
setTimeout(function () {
349+
_this.removeListener(type, onceCallback);
350+
}, 0);
349351

350352
callback(event);
351353
}

0 commit comments

Comments
 (0)