We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 37e3852 commit a1dd8d0Copy full SHA for a1dd8d0
dev/user.clj
@@ -0,0 +1,17 @@
1
+(ns user)
2
+
3
+(defmacro jit [sym]
4
+ `(requiring-resolve '~sym))
5
6
+(def portal-instance (atom nil))
7
8
+(defn portal
9
+ "Open a Portal window and register a tap handler for it. The result can be
10
+ treated like an atom."
11
+ []
12
+ ;; Portal is both an IPersistentMap and an IDeref, which confuses pprint.
13
+ (prefer-method @(jit clojure.pprint/simple-dispatch) clojure.lang.IPersistentMap clojure.lang.IDeref)
14
+ (let [p ((jit portal.api/open) @portal-instance)]
15
+ (reset! portal-instance p)
16
+ (add-tap (jit portal.api/submit))
17
+ p))
0 commit comments