Functions that return an EventEmitter should instead return a Promise
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 5.8k
- Forks
- 704
- PR merge metrics
- No merged PRs in 30d
Description
The only two functions that do this are Commit.history and Tree.walk.
All other async functions in nodegit return promises.
Current:
tree.walk()
.on('entry', singleEntryCallback)
.on('end', allEntriesCallback)
.start();
Proposed change:
tree.walk(singleEntryCallback)
.then(allEntriesCallback);
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 by locating the JavaScript entry points for Commit.history and Tree.walk. Compare their current EventEmitter usage with the proposed callback-and-Promise form, then verify that both functions follow the same async convention as the other NodeGit functions. Done means both APIs use the proposed form and their existing entry and completion behavior remains covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- api
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100