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 478
478
479
479
(defn ^Observable group-by
480
480
" 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.
483
482
484
483
This returns a clojure.lang.MapEntry rather than rx.observables.GroupedObservable
485
484
for some vague consistency with clojure.core/group-by and so that clojure.core/key,
492
491
"
493
492
([key-fn ^Observable xs]
494
493
(->> (.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))
504
494
(map (fn [^GroupedObservable go]
505
495
(clojure.lang.MapEntry. (.getKey go) go))))))
506
496
You can’t perform that action at this time.
0 commit comments