R
Reactiflux

✅ – ✅ – Sourdface – 05-35 Jun 9

✅ – ✅ – Sourdface – 05-35 Jun 9

SSourdface6/9/2023
I have a style/linting question standard.js is telling me I shouldn't use "new Promise()" for side effects because I'm not assigning or returning it. The goal is to get the work to be performed outside of the event currently being processed by the js engine's main event loop What is the actual issue here, and what should I be doing instead? Oh. Well ok, I thought that the executor function didn't run until the current event had completed, but apparently it runs in the same stack as the caller. So using Promise in this way won't give me the desired effect. It looks like what I want is setTimeout(() => { /* code */ }, 0)
UUUnknown User6/10/2023
4 Messages Not Public
Sign In & Join Server To View

Looking for more? Join the community!

R
Reactiflux

✅ – ✅ – Sourdface – 05-35 Jun 9

Join Server