Last active
August 29, 2015 14:04
-
-
Save ul/2064977d1a64fdefb398 to your computer and use it in GitHub Desktop.
SOwS2
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 app.core | |
(:require-macros [cljs.core.async.macros :refer [go-loop]] | |
[cljs.core.match.macros :refer [match]]) | |
(:require [clojure.data :refer [diff]] | |
[cljs.core.async :as async :refer [<!]] | |
[cljs.core.match] | |
[om.core :as om :include-macros true] | |
[taoensso.sente :as sente :refer (cb-success?)])) | |
(def app-state (atom { | |
;; Initial application state | |
})) | |
(defn app [app owner] | |
;; Top-level component | |
) | |
(let [{:keys [chsk ch-recv send-fn]} | |
(sente/make-channel-socket! "/chsk" ; Note the same path as before | |
{:type :auto ; e/o #{:auto :ajax :ws} | |
})] | |
(def chsk chsk) | |
(def ch-chsk ch-recv) ; ChannelSocket's receive channel | |
(def chsk-send! send-fn)) ; ChannelSocket's send API fn | |
(om/root app app-state {:target (js/document.getElementById "app")} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment