Skip to content

Instantly share code, notes, and snippets.

@souenzzo
Created October 31, 2019 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save souenzzo/d4efd1d58515679fb51761c2e1ae350d to your computer and use it in GitHub Desktop.
Save souenzzo/d4efd1d58515679fb51761c2e1ae350d to your computer and use it in GitHub Desktop.
(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