From 740e7905854d2792407926e660e33d23782aec2d Mon Sep 17 00:00:00 2001 From: Aitor Moreno Date: Fri, 27 Feb 2026 12:12:27 +0100 Subject: [PATCH] :tada: Add active-features? helper function (#8490) --- frontend/src/app/main/features.cljs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/frontend/src/app/main/features.cljs b/frontend/src/app/main/features.cljs index 9fc02dfe5a..c0f11c89fb 100644 --- a/frontend/src/app/main/features.cljs +++ b/frontend/src/app/main/features.cljs @@ -86,6 +86,24 @@ :else (enabled-by-flags? state feature)))) +(defn active-features? + "Given a state and a set of features, check if the features are all enabled." + ([state a] + (js/console.warn "Please, use active-feature? instead") + (active-feature? state a)) + ([state a b] + (and ^boolean (active-feature? state a) + ^boolean (active-feature? state b))) + ([state a b c] + (and ^boolean (active-feature? state a) + ^boolean (active-feature? state b) + ^boolean (active-feature? state c))) + ([state a b c & others] + (and ^boolean (active-feature? state a) + ^boolean (active-feature? state b) + ^boolean (active-feature? state c) + ^boolean (every? #(active-feature? state %) others)))) + (def ^:private features-ref (l/derived (l/key :features) st/state))