summaryrefslogtreecommitdiff
path: root/src/app
diff options
context:
space:
mode:
authorDavid Barksdale <amatus@amatus.name>2016-12-03 21:53:42 -0600
committerDavid Barksdale <amatus@amatus.name>2016-12-03 21:59:04 -0600
commit9e6202a904fe720d35dc26a6943c0c38acee05d4 (patch)
treeff6a8f2ef79eed9c4a938072bf1db411a7e449ee /src/app
parentc1a465a5fb7186f8694d11daa5f0818b830e38a0 (diff)
Playing with castra
Diffstat (limited to 'src/app')
-rw-r--r--src/app/api.clj6
-rw-r--r--src/app/handler.clj2
-rw-r--r--src/app/rpc.cljs11
3 files changed, 18 insertions, 1 deletions
diff --git a/src/app/api.clj b/src/app/api.clj
new file mode 100644
index 0000000..0f7ab17
--- /dev/null
+++ b/src/app/api.clj
@@ -0,0 +1,6 @@
+(ns app.api
+ (:require [castra.core :refer [defrpc]]))
+
+(defrpc get-state []
+ {:inputs []
+ :outputs []})
diff --git a/src/app/handler.clj b/src/app/handler.clj
index eb0c2a3..22b2d2d 100644
--- a/src/app/handler.clj
+++ b/src/app/handler.clj
@@ -12,7 +12,7 @@
(def app
(-> app-routes
- (castra/wrap-castra 'app.api)
+ (castra/wrap-castra {:state-fn (fn [] "ohi")} 'app.api)
(d/wrap-defaults d/api-defaults)))
(db/init)
diff --git a/src/app/rpc.cljs b/src/app/rpc.cljs
index 7edbc4c..1651f72 100644
--- a/src/app/rpc.cljs
+++ b/src/app/rpc.cljs
@@ -4,3 +4,14 @@
(:require
[javelin.core]
[castra.core :refer [mkremote]]))
+
+(defc state nil)
+(defc error nil)
+(defc loading nil)
+
+(def get-state
+ (mkremote 'app.api/get-state state error loading))
+
+(defn init []
+ (get-state)
+ (js/setInterval get-state 1000))