-
Notifications
You must be signed in to change notification settings - Fork 46
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
Dev/nivalterman/CV api 5.12.0 #94
base: main
Are you sure you want to change the base?
Conversation
@microsoft-github-policy-service agree company="Microsoft" |
@@ -1029,6 +1029,14 @@ declare module powerbi { | |||
export interface FilterTypeDescriptor { | |||
selfFilter?: boolean; | |||
} | |||
|
|||
export const enum PendingChangesType { | |||
"Filters", |
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 would prefer to receive some human meaningful value instead of type number. That could help a lot when debugging a visual.
-
Also, for this type, a single count naming or continuous action is better in my opinion.
Filter = "FILTER"
orFiltering = "FILTERING"
(uppercase is up to you). While "Filters" might be considered as some set of multiple values.
} | ||
|
||
export type PendingChanges = { | ||
[key in PendingChangesType]?: boolean; |
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 think, as we are working with Enum, key
is a bad naming in a mapped type here. Someone could expect that a key of enum element is used, while in fact value is used here.
For example, in current realization, 0
value is used, and not the "Filters"
, while "Filters"
would be considered as a key in terms of "key - value" concept.
export type PendingChanges = {
[key in PendingChangesType]?: boolean;
};
Now the code above will create the following type structure:
export type PendingChanges = {
0: boolean;
}
"0" is a result of PendingChangesType.Filters
enumeration "value" - 0
, not the enumeration "key" - Filters
.
In other words, it would be better to call it something like: [enumValue in PendingChangesType]?: boolean;
, if you want to use this sorting method and values from Enum.
options.pendingChanges
pendingChanges[Filters]
)