documentcloud / documentcloud/underscore-contrib
Improved API to mapArgs?
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 622
- Forks
- 114
- PR merge metrics
- No merged PRs in 30d
Description
I'm wondering if it would be better to have _.mapArgs not be curried. As of right now it is used like so:
squareAndDouble = _.mapArgs(doubleNum)(square);
squareAndDouble(3);
// => 18
However, I'd find the following more intuitive.
squareAndDouble = _.mapArgs(doubleNum, square);
squareAndDouble(3);
// => 18
This keeps the typical Underscore pattern of putting the "operand" value first, and the "operator" value second within one call. Is there a compelling reason to use the curried version @fogus ?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the _.mapArgs implementation and inspect its existing uses to understand the current curried API. Compare those uses with the proposed two-argument form; done means the project has an agreed API direction and corresponding behavior, with compatibility expectations clarified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100