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
(ns async-example.core | |
(:require [clojure.core.async :refer [chan go >! <!!]]) | |
(:gen-class)) | |
(defn my-pmap [f col] | |
(let [chans (repeatedly (count col) chan)] | |
(doseq [[c e] (map vector chans col)] | |
(go (>! c (f e)))) | |
(map <!! chans))) |
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
(ns example | |
(:require [reagent.core :as r :refer [atom]] | |
[reagent.cursor :as c])) | |
(defn input [prompt val] | |
[:div | |
prompt | |
[:input {:value @val | |
:on-change #(reset! val (.-target.value %))}]]) |