File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
language-adaptors/rxjava-clojure/src
main/clojure/rx/lang/clojure
test/clojure/rx/lang/clojure Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change 285
285
(defn ^Observable seq->o
286
286
" Make an observable out of some seq-able thing. The rx equivalent of clojure.core/seq."
287
287
[xs]
288
- (if xs
289
- (Observable/from ^Iterable xs )
288
+ (if-let [s ( clojure.core/seq xs)]
289
+ (Observable/from ^Iterable s )
290
290
(empty )))
291
291
292
292
; ################################################################################
Original file line number Diff line number Diff line change 166
166
(deftest test-seq->o
167
167
(is (= [] (b/into [] (rx/seq->o []))))
168
168
(is (= [] (b/into [] (rx/seq->o nil ))))
169
+ (is (= [\a \b \c] (b/into [] (rx/seq->o " abc" ))))
169
170
(is (= [0 1 2 3 ] (b/first (rx/into [] (rx/seq->o (range 4 ))))))
170
171
(is (= #{0 1 2 3 } (b/first (rx/into #{} (rx/seq->o (range 4 ))))))
171
172
(is (= {:a 1 :b 2 :c 3 } (b/first (rx/into {} (rx/seq->o [[:a 1 ] [:b 2 ] [:c 3 ]]))))))
You can’t perform that action at this time.
0 commit comments