This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use 'clojure.core.async) | |
;this is the function you want to use | |
(defn lazy-channels [chs] | |
(lazy-seq (cons (let [ [v _] (alts!! chs)] v) (lazy-channels chs)))) | |
;now for the tesging | |
(def chs [ (chan) (chan) (chan) ]) ; the channels can come from anywhere, here we are using three channels for testing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def react-sortable-hoc (aget js/window "deps" "react-sortable-hoc")) | |
(defn make-sortable-element-component [wrapped-component] | |
(let [sortable-element-factory (.-SortableElement react-sortable-hoc)] | |
(-> wrapped-component | |
r/reactify-component | |
sortable-element-factory | |
r/adapt-react-class))) | |
(defn make-sortable-container-component [wrapped-component] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; util | |
(defn tag-dispatch [dispatch tag] | |
(fn [msg] | |
(let [tagged (if (vector? tag) | |
(conj tag msg) | |
[tag msg])] | |
(dispatch tagged)))) | |
; counter |
OlderNewer