1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-28 00:17:12 +01:00
unleash.unleash/frontend/src/component/playground/Playground/AdvancedPlaygroundResultsTable/combinationCounter.ts
Thomas Heartman 12c00733d9
feat: count number of combinations from playground (#4077)
This PR adds plausible tracking of the number of feature combinations
that we get from the advanced playground API.

The event type has been added to plausible

 Relates to #3545
2023-06-23 09:29:13 +00:00

13 lines
340 B
TypeScript

import { AdvancedPlaygroundFeatureSchema } from 'openapi';
export const countCombinations = (
features: AdvancedPlaygroundFeatureSchema[]
) =>
features.reduce(
(total, feature) =>
total +
Object.values(feature.environments).flatMap(env => Object.keys(env))
.length,
0
);