-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
reducer: refactor complexity to On #103672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
natemoo-re
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These all seem very reasonable!
| // TODO: result.union(s) when Set.prototype.union is Baseline | ||
| // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/union | ||
| (result, s) => new Set([...result, ...s]), | ||
| new Set([]) | ||
| ); | ||
| return Object.values(TagFilterData).reduce<Set<string>>((acc, set) => { | ||
| for (const tag of set) { | ||
| acc.add(tag); | ||
| } | ||
| return acc; | ||
| }, new Set()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking at the comment: Set.union is baseline since June 2024. also we could probably run this once instead of having a function that does this?
export const sentryDefaultTags = Object.values(TagFilterData).reduce(
(result, s) => result.union(s),
new Set()
);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm probably more conservative than I need to be here tbh, in part because I don't trust our tooling to tell me if this falls into our browserslist or not. Would be great to know if we should be seeing any warnings here or not
Refactor reducer spread or concat operations in a couple places where this might be sensitive
Refactor reducer spread or concat operations in a couple places where this might be sensitive