May 21, 2025 await new Promise((r) => setTimeout(r, 1000)); This is just a delay function that pauses execution for 1 second. So the generateVitals generator will produce a new value after 1 second after the value is requested.
await new Promise((r) => setTimeout(r, 1000));This is just a delay function that pauses execution for 1 second. So the generateVitals generator will produce a new value after 1 second after the value is requested.