Skip to content

Commit ea2fd75

Browse files
committed
Remove val-fn version of group-by
1 parent 9bc5a85 commit ea2fd75

File tree

1 file changed

+1
-11
lines changed
  • language-adaptors/rxjava-clojure/src/main/clojure/rx/lang/clojure

1 file changed

+1
-11
lines changed

language-adaptors/rxjava-clojure/src/main/clojure/rx/lang/clojure/core.clj

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -478,8 +478,7 @@
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,
@@ -492,15 +491,6 @@
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

0 commit comments

Comments
 (0)