How about just adding a parameter that tells you whether it was delayed for
taking too long:
```js
asap(function (tooLong) {
if (tooLong) {
//attempt to restore invariants here
}
//do work here
})
```
And then follow @domenic's solution of just pushing it into the next macro-task
if it's spent too long executing micro tasks.
That way users who didn't care about such invariants could just ignore that
argument and those who do can choose how to handle it gracefully.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss