Comparing ES7 and core.async
| ES7 | core.async |
|---|---|
async function() {...} |
(fn [] (go ...)) |
await ... |
(<! ...) |
await* or Promise.all(...) |
(doseq [c ...] (<! c)) |
| ES7 | core.async |
|---|---|
async function() {...} |
(fn [] (go ...)) |
await ... |
(<! ...) |
await* or Promise.all(...) |
(doseq [c ...] (<! c)) |
| (require '[clojure.core.async :as async] | |
| '[clj-http.client :as client] | |
| '[clojure.data.json :as json]) | |
| (def concurrency 5) | |
| (let [in (async/chan) | |
| out (async/chan) | |
| request-handler (fn [url out*] | |
| (async/go |
This is the example that comes with the reagent template converted to use HTML5 based history. This means there are no # in the urls.
I just got this working, so there might be better approaches
The changes are
goog.history.Html5history instead of goog.History| find app/src -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \; |
| ;; | |
| ;; NS CHEATSHEET | |
| ;; | |
| ;; * :require makes functions available with a namespace prefix | |
| ;; and optionally can refer functions to the current ns. | |
| ;; | |
| ;; * :import refers Java classes to the current namespace. | |
| ;; | |
| ;; * :refer-clojure affects availability of built-in (clojure.core) | |
| ;; functions. |