Liking cljdoc? Tell your friends :D

Chan utils

Clojars Project

[mvc-works/chan-utils "0.1.0-a1"]

Usage

  • chan-utils.core/chan-once is a macro for creating a channel.
(chan-once cb-name body)

cb-name is the new variable for callback. For example, use got as the name:

(go
 (let [data (<! (chan-once got
                  (js/setTimeout
                    (fn [] (got 1)) 4000)))]
   (println "data" data)))
  • chan-utils.core/all-once is a function gathering a list of channels, and return values in a list after all of them finished.
(cumulo-util.async/all-once get-chan [1 2 3 4]) ; like Promise.all

License

MIT

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close