This file contains hidden or 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_match | |
(:require [cljs.core.async :refer [chan sliding-buffer]] | |
[clojure.string :as string]) | |
(:require-macros | |
[cljs.core.async.macros :as m :refer [go alts!]] | |
[clojure.core.match.js :refer [match]])) | |
(def mc (chan (sliding-buffer 1))) | |
(def loc-div (.getElementById js/document "location")) |
This file contains hidden or 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
;; based on http://talks.golang.org/2012/concurrency.slide#50 | |
(ns robpike | |
(:require [cljs.core.async :as async :refer [<! >! chan close!]]) | |
(:require-macros [cljs.core.async.macros :as m :refer [go alt!]])) | |
(defn timeout [ms] | |
(let [c (chan)] | |
(js/setTimeout (fn [] (close! c)) ms) | |
c)) |
This file contains hidden or 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
(defn debounce | |
([c ms] (debounce (chan) c ms)) | |
([c' c ms] | |
(go | |
(loop [start nil loc (<! c)] | |
(if (nil? start) | |
(do | |
(>! c' loc) | |
(recur (js/Date.) nil)) | |
(let [loc (<! c)] |
This file contains hidden or 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-test.throttle.core | |
(:require [cljs.core.async :refer [chan close!o sliding-buffer]] | |
[clojure.string :as string]) | |
(:require-macros | |
[cljs.core.async.macros :as m :refer [go alts!]])) | |
(def c (chan (sliding-buffer 1))) | |
(def loc-div (.getElementById js/document "location")) | |
(.addEventListener js/window "mousemove" |
This file contains hidden or 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-test.core | |
(:require [cljs.core.async :refer [chan]] | |
[clojure.string :as string]) | |
(:require-macros | |
[cljs.core.async.macros :as m :refer [go alt! alts!]])) | |
(def c (chan)) | |
(def loc-div (.getElementById js/document "location")) | |
(.addEventListener js/window "mousemove" |
This file contains hidden or 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 hammock-cafe.ui.history | |
(:require [io.pedestal.app.protocols :as p] | |
[io.pedestal.app.util.log :as log] | |
[io.pedestal.app.messages :as msg])) | |
(def last-page (atom nil)) | |
(def dispatchers (atom {})) | |
(defn navigate [token] |
This file contains hidden or 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 trace | |
(:use clojure.pprint)) | |
(declare trace-form) | |
(def *ignore* | |
'#{def quote var try monitor-enter monitor-exit}) | |
(defmulti trace-special-form (fn [form] (first form))) |
NewerOlder