Skip to content

Commit

Permalink
Merge 290d384 into a2cbf61
Browse files Browse the repository at this point in the history
  • Loading branch information
filipomar authored Jun 27, 2023
2 parents a2cbf61 + 290d384 commit 4ab0e17
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,14 @@ const xtend = require('xtend')
const debug = require('debug')('mqttjs:client')
const nextTick = process ? process.nextTick : function (callback) { setTimeout(callback, 0) }
const setImmediate = global.setImmediate || function (callback) {
// Copy function arguments
const args = new Array(arguments.length - 1)
for (let i = 0; i < args.length; i++) {
args[i] = arguments[i + 1]
}

// works in node v0.8
nextTick(callback)
nextTick(function () { callback.apply(undefined, args) })
}
const defaultConnectOptions = {
keepalive: 60,
Expand Down

0 comments on commit 4ab0e17

Please sign in to comment.