Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve Promise-compliance #8

Conversation

jonaskuske
Copy link
Contributor

@jonaskuske jonaskuske commented Nov 26, 2022

FYI, got both the subclassed version and the standalone one (doesn't rely on Promise at all) to work!
Both pass your tests and the A+ test suite and I managed to get the types working, too :)

You can switch between the implementations by adjusting the commented exports at the bottom in DeferredPromise.ts, and run the tests with npm test && npm run test-aplus.

Give them a try and feel free to use them or to borrow stuff for your impl :)

@kettanaito
Copy link
Member

kettanaito commented Dec 7, 2022

This is truly impressive! Thank you so much for working on this.

I like the subclass implementation since we can rely on the native Promise that way. It'd be great if we could reuse/change the createDeferredExecutor function so it can be used standalone and also power the subclass. I will see if I can do that.

@kettanaito
Copy link
Member

I rewrote it a bit to use a deferred executor. The tests are passing, I think it works as expected.

@kettanaito kettanaito changed the title other implementations now working feat: improve Promise-compliance Dec 7, 2022
Copy link
Member

@kettanaito kettanaito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fantastic! Thank you, @jonaskuske!

Is there any way I can buy you a coffee?

@kettanaito kettanaito merged commit a1effdc into open-draft:feat/improve-compatibility Dec 7, 2022
@jonaskuske
Copy link
Contributor Author

Thanks! Glad the integration with the external executor fn went so smoothly :)
(and thanks for the readme mention!)

As for ☕, there's ko-fi or paypal.me, if you want 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants