Add minor optimizations to tab-container react component

This commit is contained in:
Andrey Antukh 2024-01-08 17:51:33 +01:00
parent e0a1cd6e77
commit eeaee5ad42
7 changed files with 48 additions and 43 deletions

View file

@ -34,3 +34,13 @@
(.push ^js a v1 v2 v3 v4 v5 v6)
a))
(defn normalize-to-array
"If `o` is an array, returns it as-is, if not, wrap into an array."
[o]
(if (array? o)
o
#js [o]))
(defn without-nils
[^js/Array o]
(.filter o (fn [v] (some? v))))