[RFC] Remove some()
, map()
, reduce()
functions
#219
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This simple PR suggests removing the
some()
,map()
,reduce()
functions to reduce the API surface. With these changes applied, our API is pretty much identical to ES6 promises commonly used in JavaScript. This makes our APIs appear less complex and thus easier to understand.Empirical evidence suggests these functions aren't used very commonly in our ecosystem either, so I'd rather use the chance to clean up our API surface with the upcoming Promise v3 release. I don't currently see a prominent need for these functions, but I'm open to the idea of reintroducing them later if needed. There's reason to believe that these functions could (should?) exist as part of our new reactphp/async package, especially considering how it mimics part of async.js.
I'm filing this as an RFC to get more feedback on these functions and to see how others feel about this. If this gets merged, I'll file a follow-up PR to deprecate these functions for Promise v2 to ease upgrading.
Refs #35