Skip to content

Instantly share code, notes, and snippets.

@souenzzo

souenzzo/xf.clj

Created Oct 31, 2019
Embed
What would you like to do?
(let [atributo->item {:a {:atributo :a
:selecionado? true}
:b {:atributo :b
:selecionado? false}
:c {:atributo :c}}]
{:reduce (reduce-kv (fn [acc k {:keys [selecionado?]}]
(if (false? selecionado?)
acc
(conj acc k)))
#{}
atributo->item)
:for (set (for [[k {:keys [selecionado?]}] atributo->item
:when (not (false? selecionado?))]
k))
:xf (into #{}
(comp (remove (comp false? :selecionado? val))
(map key))
atributo->item)})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.