I'm producing more than one element on the 1-arity of the transducer, and sequence is only considering the last one.
Here is the transducer and the tests that fail for sequence:
`
(defn sliding-window [n]
(fn [rf]
(let [a #js []]
(fn
([] (rf))
([result]
(loop [] ;; Here I'm emitting more than one element
(when (not-empty a)
(rf result (vec (js->clj a)))
(.shift a)
(recur))))
([result input]
(.push a input)
(if (== n (.-length a))
(let [v (vec (js->clj a))]
(.shift a)
(rf result v))
result))))))
;;This test fails! =(
(deftest sliding-window-in-a-sequence
(is (= [[5 4 3]
[4 3 2]
[3 2 1]
[2 1]
[1]]
(sequence (sliding-window 3) [5 4 3 2 1])))
(is (= [[2 1]
[1]]
(sequence (sliding-window 3) [2 1]))))
`