Fork me on GitHub
#om
<
2015-07-06
>
jamiei08:07:02

@joshg: Feed the result of map-indexed into om/build?

joshg08:07:21

@jamiei: right, you could pass the index into :opts

joshg08:07:03

@jamiei:

(map-indexed (fn [idx x] (om/build some-component x {:opts {:index idx}})) xs)

jamiei08:07:31

@joshg: Apologies, I had forgotten about the :opts, can it be accessed easily from within some-component?

joshg08:07:21

@jamiei: yes, when you define your component: (defn some-component [data owner {:keys [index]}] …)

joshg08:07:34

(you’ll probably need to set :react-key as well)

jamiei08:07:49

Ah, thanks @joshg , really helpful.