Sourdface
Sourdface14mo ago

✅ – ✅ – Sourdface – 05-35 Jun 9

I have a style/linting question
3 Replies
Sourdface
Sourdface14mo ago
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)
reactibot
reactibot14mo ago
This question has an answer! Thank you for helping 😄 If you have a followup question, you may want to reply to this thread so other members know they're related. https://discord.com/channels/102860784329052160/565213527673929729/1116601383118975016
reactibot
reactibot14mo ago
This question has an answer! Thank you for helping 😄 If you have a followup question, you may want to reply to this thread so other members know they're related. https://discord.com/channels/102860784329052160/565213527673929729/1116601383118975016 This thread hasn’t had any activity in 36 hours, so it’s now locked. Threads are closed automatically after 36 hours. If you have a followup question, you may want to reply to this thread so other members know they're related. https://discord.com/channels/102860784329052160/565213527673929729/1116601383118975016