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

A different API would be better #1

Open
ghost opened this issue Sep 14, 2017 · 3 comments
Open

A different API would be better #1

ghost opened this issue Sep 14, 2017 · 3 comments

Comments

@ghost
Copy link

ghost commented Sep 14, 2017

Imho it would be better to use methods or constants instead of using state strings. e.g. let state = promise.inspect(); console.log(state.isFullfilled()); or console.log(promise.isFulfilled());. Method and constant names can be auto-completed and so harder to mistype.

@JoshuaWise
Copy link
Owner

JoshuaWise commented Sep 14, 2017

But I understand your point. I'll consider it if it gathers more support.

@ghost
Copy link
Author

ghost commented Sep 14, 2017

I think nothing prevents us from using both. You can always add a few non-enumerable methods to the state object with Object.defineProperty. Or defining them in a prototype would do the same.

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

No branches or pull requests

1 participant