-
Notifications
You must be signed in to change notification settings - Fork 152
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
should return an error if passed object is not a promise #15
Comments
I personally find the eg.
|
@bitstrider Hey, I didn't understand you, can you be little more descriptive with "await fuzzy type" handling |
@agarwalkartik I give a better example in the issue here #17 if that helps. My argument is that the normal behavior when awaiting a non-promise type is to simply let the it pass through, and so this should be the same with // the desired behavior
const A = await 42; //> 42
const [err, B] = await on(42); //> [null, 42] |
@bitstrider Yes I agree, any ideas on how can we implement it in this library? |
@agarwalkartik I ended up creating a new project to implement the feature since this project seems to be unmaintained https://github.com/bitstrider/await-on |
Not exactly sure that the library should support this fuzziness. feel free to create your own helper function suited for your needs. This is library is about sharing a concept and the use of it should not be tied to specific implementation. |
If the passed object is not a promise then
to()
should return an error.This feature is quite useful when using
await-to-js
in a non type script environment.The text was updated successfully, but these errors were encountered: