Advertisement
dredder_gun

mapv clojure

Jan 14th, 2018
1,279
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (let [change-dish-count (fn [dishes_vec i] (mapv #(if (= i (:menu-item-id %)) (assoc % :count count_d) %) dishes_vec))]
  2.  (mapv #(if (= (:id %) (:active-receipt db))
  3.                                         (update % :dishes change-dish-count (:id dish_map))  
  4.                                         %)
  5.                                      vector-of-maps))
Advertisement
RAW Paste Data Copied
Advertisement