From eef57a3046547a457cfcd3adbc0abab7859eab43 Mon Sep 17 00:00:00 2001 From: pablodip Date: Wed, 31 Jan 2018 16:06:01 +0100 Subject: [PATCH] add some docstrings --- src/cljs/commiteth/ui_model.cljs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/cljs/commiteth/ui_model.cljs b/src/cljs/commiteth/ui_model.cljs index 0a99444..2efba9c 100644 --- a/src/cljs/commiteth/ui_model.cljs +++ b/src/cljs/commiteth/ui_model.cljs @@ -48,6 +48,9 @@ (bounty-filter-type-date-options-def option)) (def bounty-filter-type-date-pre-predicate-value-processor + "It converts an option of the filter type date to a cljs-time interval in which + that option is valid, so that you can check `cljs-time.core.within?` against that + interval and know if a `cljs-time` date is valid for that filter type date option." (fn [filter-value] (let [filter-from (condp = filter-value ::bounty-filter-type-date-option|last-week (t/minus (t/now) (t/weeks 1)) @@ -137,6 +140,11 @@ (str filter-type " with val " filter-value))) (defn- bounty-filter-values-by-type->predicates [filters-by-type] + "It receives a map with filter types as keys and filter values as values and + returns a lazy seq of predicates, one for each pair of filter type and value. + Those predicate can receive a bounty and tell whether that bounty passes + the filter type with that filter value. It removes filter types with a `nil` + filter value." (->> filters-by-type ; used `nil?` because a valid filter value can be `false` (remove #(nil? (val %)))