-
Notifications
You must be signed in to change notification settings - Fork 4
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
Replacing the "resolve" verb #9
Comments
Good summary, thanks! Seems like we need a word which is not "resolve" that means "seal the fate of p". Or we have to extend the definition of "resolved" to mean "a promise whose fate has been sealed, and may or may not have been met"--that seems like it may confuse people more. In another thread somewhere, I proposed "assume": assume(x) causes p to assume x's state/value. Very similar to adopt. |
New favorite via MarkM: "reveal". It's especially nice as a counterpart to "reject" and makes a lot of sense when used in this type of context: var p = new Promise(function (reveal, reject) {
if (Math.random() > 0.5) {
reject(new Error("the universe doesn't like you today"));
}
reveal(5);
}); or playing off ideas from previous threads, maybe var p = new Promise(function (resolver) {
if (Math.random() > 0.5) {
resolver.reject(new Error("the universe doesn't like you today"));
}
resolver.reveal(5);
}); although this keeps the "resolver" noun which has only an indirect connection to the "resolved" state. Alternately var p = new Promise(function (reveal) {
if (Math.random() > 0.5) {
reveal.reject(new Error("the universe doesn't like you today"));
}
reveal(5);
}); |
I agree "reveal" is a very nice word, and a nice counterpart to "reject"--even the same number of letters. I'm not sure it works well in this case tho: |
Another one from MarkM: "settle". |
Microsoft is using |
FWIW, I have no qualms with |
@lsmith I don't think it's moot unless we abolish the use of "resolved" as a state encompassing "fulfilled or rejected." There could be another issue for replacing the adjective as opposed to the verb, if people think that would be fruitful. |
@domenic Just a gut reaction here, but I'd say addressing the adjective would be a better approach. The promise is either pending or it's not. There are plenty of options here: "sealed", "completed", "active/inactive", "open/closed". Bummer that "unpending" isn't a word. That said, I'm still fine with the imperfection of "resolved" as well. |
When I posted above about changing the meaning of "resolved", I thought it would be more confusing to people, but hearing you guys talk about it makes me think it may be the right way to go. We could simply redefine "resolved" (or maybe we'd be formally defining it in the first place) to mean what we want it to mean. Are you thinking that "pending" and "resolved" are mutually exclusive? i.e. if I have a promise, p1, that has been "resolved" with another pending promise, do we say that p1 is still pending? Or do we say that p1 is "resolved", but not yet fulfilled or rejected? The latter seems right to me. This has implications with promises-aplus/promises-spec#61 as well, since the proposal there was to define |
Back on the verb naming, just thought of: "commit" |
On the adjective front, we use "completed". Other suggestions... "finished", "done", and "decided".
For the verb, I'm curious why |
@skaegi there's a difference between "resolve" as the promise community uses it, "resolve" as jQuery uses it, and "fulfill" as the promise community uses it:
|
Thanks @domenic -- suddenly your initial post makes much more sense. |
Another one that just popped into my head: "follow". |
I like |
FWIW I'm coming around to the replace-the-adjective approach. A lot of this depends on how we resolve the reject vs. polymorphicReject question though. |
What about Doesn't seem great from an English standpoint ("I accept my promise with this other promise", "I accept my promise with the value 5"), but is an interesting counterpart to |
Ah, |
As per #16, another suggestion: |
Here is our terminology problem with current libraries:
operation(x)
coupled to promisep
where ifx
is a non-promise value,p
becomes fulfilled withx
, and ifx
is a promise,p
adopts its state, either immediately or eventually. Currently this is called "resolve."Let's use this thread to think of replacements for the verb in 2, assuming that we keep the state name as of 3.
Ideas so far:
yield
keyword.)No ideas that jump out at me so far... anyone got anything better?
The text was updated successfully, but these errors were encountered: