DEV Community

Discussion on: Resumable JavaScript with Qwik

Collapse
 
drsensor profile image
૮༼⚆︿⚆༽つ

Here is a simple scenario in gamedev (with parallelize ECS) where you don't want to lazy load the event handler nor put them in the queuMicrotask

<button on:click=(() => {
  for (const [typedArray, offset, [entity, health]] of queryRaw(enemyHealth)) {
    Atomics.sub(typedArray, offset, 20)
    physicsKnockback(entity, 50)
  }
})>
Enter fullscreen mode Exit fullscreen mode