I have the example code using async/await in typescript
async function start() {
for (let i = 0; i < 10; i++) {
if (i >= 5) {
break;
}
await sleep(10);
}
}
The code is compiled blow in es6:
function start() {
return __awaiter(this, void 0, void 0, function* () {
if (i >= 5) {
break;
}
yield (0, sleep_1.sleep)(10);
})
}
Now, i want to rewrite this code in rescript, but i don’t know how to do this, can anyone help me?