cefn / watchable

Repo for @watchable/store and supporting packages.
MIT License
5 stars 1 forks source link

Treat functions as executors #63

Closed cefn closed 5 months ago

cefn commented 5 months ago

In https://github.com/cefn/watchable/issues/62 @davidfiala reported that some thenables (which were not strictly instanceof Promise) were taking the wrong path in the constructor arg to Unpromise. They ended up being interpreted as an executor function instead leading to bugs.

In this PR the check is inverted and is therefore a bit more safe. It won't mistakenly treat a non-function as a Promise executor.

davidfiala commented 5 months ago

Thank you! I think this fixes the immediate issue. I left some other ideas in the bug.

cefn commented 5 months ago

Released in https://www.npmjs.com/package/@watchable/unpromise/v/0.1.0-alpha.7