smartcontractkit / smartcontractkit/data-streams-sdk
Add 'once' support
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 11
- Forks
- 16
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 2
Description
Hello, guys).
Just discovered that Stream extends EventEmitter, and EventEmitter has once() method, which really helpful in some cases.
Can you add, please, once(event: "report", listener: (report: Report) => void): this; to IStream?)
Current workaround is:
return new Promise<IPullPriceFeedResponse>(async (resolve, reject) => {
(this.stream as unknown as EventEmitter).once('report', (report) => {
try {
const decoded = decodeReport(report.fullReport, report.feedID) as DecodedV3Report;
resolve(decoded);
} catch (error) {
reject(error);
}
})
})
Best regards.
Contributor guide
No contributing guide indexed for this repository
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
Locate the IStream declaration and the Stream implementation described as extending EventEmitter, then inspect how existing event methods are typed. Add the requested once signature for report listeners and verify that the public stream interface exposes it consistently with the EventEmitter behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100