Closed trueter closed 8 years ago
please could you post a reduced example which triggers this error?
Putting together the example I noticed a likely conflict between my global Promise implementation and a custom Promise that is being used by the package returning the Promise. I didn't find Promise being used in the examples so I anticipated it wasn't supported. Maybe one could add a warning hinting towards Object.keys(Promise) or another way of differentiating between these constructors. Issue can be closed.
you can use something like this to cover both cases:
type Thenable<Success,Failure> = {
then: (resolve?: (result: Success) => any, reject?: (result: Failure) => any) => Thenable
}
function someAsyncFunction (): Thenable<string> {
return Promise.resolve("hello world");
}
It won't get typechecked yet though unfortunately.
Still stuck on Babel 5 :( - but looking forward to try that going forward!
Promise support would be great: