From 938a3db094fdab12cc6a576a4022d3fbbbf9bf45 Mon Sep 17 00:00:00 2001 From: Mikko Ahlroth Date: Thu, 18 Jul 2024 01:31:37 +0300 Subject: [PATCH] No requestIdleCallback in Node --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 9fab4da..2753c89 100644 --- a/index.js +++ b/index.js @@ -149,7 +149,7 @@ class Connection { ); if (this.msgBuffer.length > 0) { - requestIdleCallback(() => { + setImmediate(() => { this.send(); }); } @@ -224,7 +224,7 @@ class Connection { this.reachabilityTimeout = null; if (this.msgBuffer.length > 0) { - requestIdleCallback(() => { + setImmediate(() => { this.send(); }); }