You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After reading the below code in feature-toggle-strategies-store.ts, I was confused with some method signatures.
I think the return type of getFeatureOverviewData should be Record<string, IFeatureOverview> instead of IFeatureOverview. Because acc[row.feature_name] = { type: ..., description: ... } suggests that acc is a record whose key is string type and value is IFeatureOverview type.
In case of the parameter type of sortEnvironments, it also might be correct to use Record<string, IFeatureOverview>. Since Object.values(overview).map((data: IFeatureOverview) strongly suggest that overview is a record whose value is IFeatureOverview type.
After reading the below code in
feature-toggle-strategies-store.ts
, I was confused with some method signatures.I think the return type of
getFeatureOverviewData
should beRecord<string, IFeatureOverview>
instead ofIFeatureOverview
. Becauseacc[row.feature_name] = { type: ..., description: ... }
suggests thatacc
is a record whose key is string type and value is IFeatureOverview type.unleash/src/lib/features/feature-toggle/feature-toggle-strategies-store.ts
Lines 731 to 777 in 79fcfc2
unleash/src/lib/types/model.ts
Lines 208 to 220 in 283a8f4
In case of the parameter type of
sortEnvironments
, it also might be correct to useRecord<string, IFeatureOverview>
. SinceObject.values(overview).map((data: IFeatureOverview)
strongly suggest thatoverview
is a record whose value isIFeatureOverview
type.unleash/src/lib/features/feature-toggle/feature-toggle-strategies-store.ts
Lines 108 to 120 in 5335422
If the suggestions make sense to you, I'm also open to make a PR for the fix. :)
The text was updated successfully, but these errors were encountered: