News for hackers. Stuff that matters.
Re:Show HN: 3 years and 1M users later, I just open-sourced ... by pjc50 on Tuesday March 05, 2024 @04:25AM (#39601138)
Re-layout has to complete before any more JS runs. So if you want to change two things, you get update-layout-update-layout.
Re:Show HN: 3 years and 1M users later, I just open-sourced ... by wizzwizz4 on Tuesday March 05, 2024 @08:17AM (#39602933)
Only if you yield to the layout engine (e.g. `await new Promise(resolve => setTimeout(resolve, 0))`) in between. Which, if you know you want to change two things, why would you?
Re:Show HN: 3 years and 1M users later, I just open-sourced ... by pjc50 on Tuesday March 05, 2024 @10:49AM (#39604973)
.. or you accidentally request a layout property: https://gist.github.com/paulirish/5d52fb081b3570c81e3a?ref=a...

(updating innerText sounds like an especially lethal trap https://source.chromium.org/chromium/chromium/src/+/main:thi... )