(children f xs)Given a function and collection will add incremental meta :key information
Example:
(:require [ant-man.core :as ant-man] [reagent.core :as r])
(def selection (r/atom nil)) (def example-collection [{:label "foo" :id 1} {:label "bar" :id 2}])
[ant-man/select {:on-change (fn [val] (reset! selection val)) :value @selection} (ant-man/children (fn [{:keys [label id]}] [ant-man/select-option {:value id} label]) example-collection)]
Given a function and collection will add incremental meta `:key` information
Example:
(:require [ant-man.core :as ant-man]
[reagent.core :as r])
(def selection (r/atom nil))
(def example-collection [{:label "foo" :id 1} {:label "bar" :id 2}])
[ant-man/select {:on-change (fn [val] (reset! selection val))
:value @selection}
(ant-man/children
(fn [{:keys [label id]}]
[ant-man/select-option {:value id} label])
example-collection)]
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |