Back
concat (clj)
(source)macro
(concat & params)
A macro variant of the clojure.core/str function that performs
considerably faster string concatenation operation on CLJS (on
JVM/CLJ it only applies basic simplification and then relies on the
`clojure.core/str`).
Examples
penpot/penpot
(ns app.main.ui.components.tabs-container
(:require
[app.common.data :as d]
[cuerdas.core :as str]
[rumext.v2 :as mf]))
[:div.tab-container
[:div.tab-container-tabs
(for [tab children]
(let [props (.-props tab)
id (.-id props)
title (.-title props)]
[:div.tab-container-tab-title
{:key (str/concat "tab-" (d/name id))
:data-id (pr-str id)
:on-click select-fn
:class (when (= selected id) "current")}
title]))]
[:div.tab-container-content
(d/seek #(= selected (-> % .-props .-id)) children)]]))
penpot/penpot
(ns app.main.ui.workspace.sidebar.assets.file-library
(:require-macros [app.main.style :as stl])
(:require
[app.common.data :as d]
[app.common.data.macros :as dm]
[app.main.data.workspace :as dw]
[app.main.data.workspace.libraries :as dwl]
[app.main.data.workspace.undo :as dwu]
[app.main.refs :as refs]
[app.main.store :as st]
[app.main.ui.components.title-bar :refer [title-bar]]
[app.main.ui.context :as ctx]
[app.main.ui.icons :as i]
[app.main.ui.workspace.libraries :refer [create-file-library-ref]]
[app.main.ui.workspace.sidebar.assets.colors :refer [colors-section]]
[app.main.ui.workspace.sidebar.assets.common :as cmm]
[app.main.ui.workspace.sidebar.assets.components :refer [components-section]]
[app.main.ui.workspace.sidebar.assets.graphics :refer [graphics-section]]
[app.main.ui.workspace.sidebar.assets.typographies :refer [typographies-section]]
[app.util.dom :as dom]
[app.util.i18n :as i18n :refer [tr]]
[app.util.keyboard :as kbd]
[app.util.router :as rt]
[cuerdas.core :as str]
[okulary.core :as l]
[rumext.v2 :as mf]))
extend-selected
(fn [type asset-groups asset-id]
(letfn [(flatten-groups [groups]
(reduce concat [(get groups "" [])
(into []
(->> (filter #(seq (first %)) groups)
(map second)
(mapcat flatten-groups)))]))]