File tree Expand file tree Collapse file tree 1 file changed +1
-11
lines changed
language-adaptors/rxjava-clojure/src/main/clojure/rx/lang/clojure Expand file tree Collapse file tree 1 file changed +1
-11
lines changed Original file line number Diff line number Diff line change 478478
479479(defn ^Observable group-by
480480 " Returns an Observable of clojure.lang.MapEntry where the key is the result of
481- (key-fn x) and the val is an Observable of (val-fn x) for each key. If val-fn is
482- omitted, it defaults to identity.
481+ (key-fn x) and the val is an Observable of x for each key.
483482
484483 This returns a clojure.lang.MapEntry rather than rx.observables.GroupedObservable
485484 for some vague consistency with clojure.core/group-by and so that clojure.core/key,
492491 "
493492 ([key-fn ^Observable xs]
494493 (->> (.groupBy xs (iop/fn* key-fn))
495- (map (fn [^GroupedObservable go]
496- (clojure.lang.MapEntry. (.getKey go) go)))))
497- ([key-fn val-fn ^Observable xs]
498- ; TODO reinstate once this is implemented
499- ; see https://github.com/Netflix/RxJava/commit/02ccc4d727a9297f14219549208757c6e0efce2a
500- (throw (UnsupportedOperationException. " groupBy with val-fn is currently unimplemented in RxJava" ))
501- (->> (.groupBy xs
502- (iop/fn* key-fn)
503- (iop/fn* val-fn))
504494 (map (fn [^GroupedObservable go]
505495 (clojure.lang.MapEntry. (.getKey go) go))))))
506496
You can’t perform that action at this time.
0 commit comments