stefanpenner / es6-promise

A polyfill for ES6-style Promises
MIT License
7.3k stars 593 forks source link

Expose flush on Promise #362

Closed bwindels closed 2 years ago

bwindels commented 3 years ago

I need to flush the queue synchronously to be able to use promises with indexeddb on some older platforms that don't check the microtask queue before closing active transactions (IE11 on Windows7), like so.

I considered using the already exposed setScheduler function but it would be hard to just flush the queue around the resolution of one promise without reimplementing the MutationObserver strategy, given that you can't assume which resolve will queue a microtask, and as I still want promises outside of idb requests to resolve async.

The changes are minimal, but the authors might or might not want to expose this. I'm happy to just keep this in a fork if not.

bwindels commented 3 years ago

Not sure why the tests fail, but seems unrelated to changes?

stefanpenner commented 2 years ago

Ya, I don't feel comfortable exposing this functionality in this library. But a fork is perfectly reason in this case.

Thank you for the PR, but I will be closing it