comparator

functionsince v0.0-1586 clojure.core/comparatorEdit
(comparator pred)

Source docstring:
Returns an JavaScript compatible comparator based upon pred.
Source code @ clojurescript:src/main/cljs/cljs/core.cljs
(defn comparator
  [pred]
  (fn [x y]
    (cond (pred x y) -1 (pred y x) 1 :else 0)))