Skip to content

Commit

Permalink
feat: Use callbacks for evaluation hotpath. (#234)
Browse files Browse the repository at this point in the history
  • Loading branch information
kinyoklion authored Aug 21, 2023
1 parent cf01b14 commit 27e5454
Show file tree
Hide file tree
Showing 5 changed files with 595 additions and 398 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ class TestQueries implements Queries {
},
) {}

async getFlag(key: string): Promise<Flag | undefined> {
return this.data.flags?.find((flag) => flag.key === key);
getFlag(key: string, cb: (flag: Flag | undefined) => void): void {
const res = this.data.flags?.find((flag) => flag.key === key);
cb(res);
}

async getSegment(key: string): Promise<Segment | undefined> {
return this.data.segments?.find((segment) => segment.key === key);
getSegment(key: string, cb: (segment: Segment | undefined) => void): void {
const res = this.data.segments?.find((segment) => segment.key === key);
cb(res);
}

getBigSegmentsMembership(
Expand Down
Loading

0 comments on commit 27e5454

Please sign in to comment.