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

Name of "when" #46

Open
kelunik opened this issue Mar 8, 2017 · 0 comments
Open

Name of "when" #46

kelunik opened this issue Mar 8, 2017 · 0 comments

Comments

@kelunik
Copy link
Member

kelunik commented Mar 8, 2017

I'm more and more thinking the method shouldn't be named when. It doesn't really matter for promise implementations with just that method such as Amp's Deferred / Placeholder, but it certainly matters if you have other methods as well.

React is one library providing further methods, but those are strictly about the core nature of a promise, getting the value or reason out. It's more problematic if a promise is more than a simple placeholder, such as Amp\Message or Aerys\BodyParser. Those implement Promise to provide a mechanism to consume the complete result easily, while at the same time allowing the consumption of intermediate results.

Currently I can offer the following suggestions: onResolve, onComplete.

Maybe this also helps differentiating between when and then, as they're quite similar currently.

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

No branches or pull requests

1 participant