-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Implementing a Generic Search Function
Description
Currently, our codebase contains specialized search functions like findDealActors and findDealClients. This creates duplication and increases the complexity of our codebase.
Proposal
Replace these specialized functions with a more generic search function, such as findPartyDeal. This would:
- Simplify the codebase
- Reduce code duplication
- Provide more flexibility
Example implementation:
const findPartyDeal = (retrievalTasks, minerId, cid, partyName) => {
const deal = retrievalTasks.find(t => t.cid === cid && t.minerId === minerId);
return deal ? deal[partyName] : undefined;
}References
Original discussion from PR comments between @pyropy and @bajtos.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
📥 candidate