code-reviews

jimmy 2017-05-15T08:24:24.533155Z

Hi guys, is there a better way to write nested map in clojure(script) ?

(defn general-table-row-ui
  [rows]
  (->> rows
       (map (fn [x]
              (d/tr
               {}
               (->> x
                    (map (fn [[_ val]]
                           (d/td {} val)))))))))

2017-05-15T09:01:18.063408Z

Maybe for produces a better-shape source code for this case.

(for [r rows]
  (d/tr {} 
    (for [[_ v] r]
      (d/td {} v))))

👍 2