From 2de1c92ee87a1629657d9a530596d0e9be33ead7 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 15 Mar 2021 08:38:32 +0100 Subject: [PATCH] :tada: Add transducer version of mapm data helper. --- common/app/common/data.cljc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/app/common/data.cljc b/common/app/common/data.cljc index 26722cf75..088a36f07 100644 --- a/common/app/common/data.cljc +++ b/common/app/common/data.cljc @@ -146,8 +146,10 @@ (defn mapm "Map over the values of a map" - [mfn coll] - (into {} (map (fn [[key val]] [key (mfn key val)]) coll))) + ([mfn] + (map (fn [[key val]] [key (mfn key val)]))) + ([mfn coll] + (into {} (mapm mfn) coll))) (defn filterm "Filter values of a map that satisfy a predicate"