-
Notifications
You must be signed in to change notification settings - Fork 4
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
Possible issue with subclassing #11
Comments
Interesting question. It seems what you're trying to achieve is going to be tricky, because of the way Promises are spec'ed. In your use-case, returning the plain Promise from The Promise spec seems to target the latter use-case, and that's what I've also basically taken over. FWIW, what I did in the past in a similar situation (http request wrapper), was to not subclass from Promise, but instead put e.g. a I'm going to close this issue for now, as I don't see how I could keep the spirit of the spec, and still allow 'your' use-case. Feel free to discuss this further, though, if you have a good idea to do this. |
Thanks for your reply |
https://github.com/poelstra/ts-promise/blob/master/src/lib/Promise.ts#L371-L375
I'm extending promise and using different constructor signature
when using the then method, the library is trying to create new instance of my subclass, with a function as the parameter but then it tried to load a new image again.
I think the library should use plain Promise when chaining
The text was updated successfully, but these errors were encountered: