@parca/store
Advanced tools
Comparing version 0.16.55 to 0.16.56
@@ -6,2 +6,6 @@ # Change Log | ||
## 0.16.56 (2023-02-09) | ||
**Note:** Version bump only for package @parca/store | ||
## 0.16.55 (2023-02-08) | ||
@@ -8,0 +12,0 @@ |
@@ -9,2 +9,3 @@ import type { ColorProfileName } from '@parca/functions'; | ||
colors: StackColorMap; | ||
binaries: string[]; | ||
} | ||
@@ -15,5 +16,18 @@ export interface StackColor { | ||
} | ||
export declare const FEATURE_TYPES: { | ||
readonly Runtime: "Runtime"; | ||
readonly Binary: "Binary"; | ||
readonly Misc: "Misc"; | ||
}; | ||
export type FeatureType = typeof FEATURE_TYPES[keyof typeof FEATURE_TYPES]; | ||
export interface Feature { | ||
name: string; | ||
type: FeatureType; | ||
} | ||
export interface FeaturesMap { | ||
[key: string]: FeatureType; | ||
} | ||
export declare const EVERYTHING_ELSE = "Everything else"; | ||
export interface SetFeaturesRequest { | ||
features: string[]; | ||
features: FeaturesMap; | ||
colorProfileName: ColorProfileName; | ||
@@ -29,3 +43,4 @@ isDarkMode: boolean; | ||
export declare const selectStackColors: (state: RootState) => StackColorMap; | ||
export declare const selectBinaries: (state: RootState) => string[]; | ||
declare const _default: import("redux").Reducer<ColorsState, import("redux").AnyAction>; | ||
export default _default; |
@@ -46,3 +46,9 @@ // Copyright 2022 The Parca Authors | ||
colors: {}, | ||
binaries: [], | ||
}; | ||
export var FEATURE_TYPES = { | ||
Runtime: 'Runtime', | ||
Binary: 'Binary', | ||
Misc: 'Misc', | ||
}; | ||
export var EVERYTHING_ELSE = 'Everything else'; | ||
@@ -79,3 +85,6 @@ var findAColor = function (colorIndex, colors) { | ||
var _a; | ||
state.colors = action.payload.features | ||
state.binaries = Object.keys(action.payload.features).filter(function (name) { | ||
return action.payload.features[name] === FEATURE_TYPES.Binary; | ||
}); | ||
state.colors = Object.keys(action.payload.features) | ||
.map(function (feature) { | ||
@@ -103,2 +112,3 @@ return [ | ||
export var selectStackColors = function (state) { return state.colors.colors; }; | ||
export var selectBinaries = function (state) { return state.colors.binaries; }; | ||
export default colorsSlice.reducer; |
{ | ||
"name": "@parca/store", | ||
"version": "0.16.55", | ||
"version": "0.16.56", | ||
"description": "State management for Parca UI", | ||
@@ -25,3 +25,3 @@ "main": "dist/index.js", | ||
}, | ||
"gitHead": "7e9b162434159a5e614c8d7c12e360ff3069da39" | ||
"gitHead": "20614b1f95352017f7cec344edf8bd152df30856" | ||
} |
@@ -26,2 +26,3 @@ // Copyright 2022 The Parca Authors | ||
colors: StackColorMap; | ||
binaries: string[]; | ||
} | ||
@@ -32,2 +33,3 @@ | ||
colors: {}, | ||
binaries: [], | ||
}; | ||
@@ -40,2 +42,19 @@ | ||
export const FEATURE_TYPES = { | ||
Runtime: 'Runtime', | ||
Binary: 'Binary', | ||
Misc: 'Misc', | ||
} as const; | ||
export type FeatureType = typeof FEATURE_TYPES[keyof typeof FEATURE_TYPES]; | ||
export interface Feature { | ||
name: string; | ||
type: FeatureType; | ||
} | ||
export interface FeaturesMap { | ||
[key: string]: FeatureType; | ||
} | ||
export const EVERYTHING_ELSE = 'Everything else'; | ||
@@ -72,3 +91,3 @@ | ||
export interface SetFeaturesRequest { | ||
features: string[]; | ||
features: FeaturesMap; | ||
colorProfileName: ColorProfileName; | ||
@@ -90,3 +109,6 @@ isDarkMode: boolean; | ||
setFeatures: (state, action: PayloadAction<SetFeaturesRequest>) => { | ||
state.colors = action.payload.features | ||
state.binaries = Object.keys(action.payload.features).filter(name => { | ||
return action.payload.features[name] === FEATURE_TYPES.Binary; | ||
}); | ||
state.colors = Object.keys(action.payload.features) | ||
.map(feature => { | ||
@@ -123,2 +145,4 @@ return [ | ||
export const selectBinaries = (state: RootState): string[] => state.colors.binaries; | ||
export default colorsSlice.reducer; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44353
687