-
-
Notifications
You must be signed in to change notification settings - Fork 146
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
Documentation improvement #110
Conversation
Thanks, that's definitely something which can be improved 👍 |
@jsor Thank you for your feedback. Now I see that |
@@ -447,10 +447,10 @@ if `$promisesOrValues` contains 0 items. | |||
$promise = React\Promise\some(array $promisesOrValues, integer $howMany); | |||
``` | |||
|
|||
Returns a promise that will resolve when `$howMany` of the supplied items in | |||
Returns a promise that will resolve when at least `$howMany` of the supplied items in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at least is wrong here. The output promise fulfills after exactly $howMany
fulfill and ignores the rest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've replaced word resolve with fulfill.
My intention with word at least was to show, that it is enough for $howMany
promises to be fulfilled. For example, when we have 3 pending promises, it is enough for 2 of them to be fulfilled. Not exactly 2 should be fulfilled, and 1 should fail.
I'm still a bit confused about statuses. Documentation says that
Does this mean that |
That sentence is wrong and we should probably rework the whole documentation to use the correct adjectives :) resolved means, the promise's fate is sealed and any subsequent calls to |
Now I see :) Thanks for clarifying 👍 |
ping @clue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seregazhuk Thanks for your patience, changes LGTM 👍 Can you squash this into a single commit?
@clue Done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR provides some suggestion for documentation improvement:
Promise\race()
.Word
resolves
confused me thatrace()
returns a promise that resolves once the first promise from the set resolves. But actually, it resolves once the first promise settles. If the settled promise resolves the resulting promise resolves with its resolution value, otherwise it resolves with a rejection reason.Promise\some()
It is not explicitly said if it expects the exact number of promises to be resolved or at least of this number. I've also added that the resolution value of the resulting promise contains resolution values from the promises that were resolved first.
Maybe these suggestions look like salt is salty, but I think that documentation should be as explicit as possible.