This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-06-19
Channels
- # aws-lambda (1)
- # bangalore-clj (4)
- # beginners (66)
- # boot (13)
- # cider (9)
- # cljs-dev (44)
- # cljsjs (3)
- # clojure (181)
- # clojure-austin (2)
- # clojure-greece (6)
- # clojure-italy (2)
- # clojure-russia (64)
- # clojure-sg (1)
- # clojure-spec (68)
- # clojure-uk (60)
- # clojurescript (66)
- # conf-proposals (12)
- # cryogen (1)
- # cursive (3)
- # datomic (44)
- # graphql (1)
- # hoplon (2)
- # jobs (2)
- # jobs-discuss (3)
- # keechma (2)
- # liberator (6)
- # luminus (2)
- # nyc (1)
- # off-topic (92)
- # om (10)
- # onyx (17)
- # parinfer (39)
- # pedestal (8)
- # proton (11)
- # re-frame (110)
- # reagent (2)
- # remote-jobs (11)
- # ring-swagger (9)
- # rum (2)
- # sql (2)
- # test-check (6)
- # untangled (138)
what should i put in an extern file for objects returned by another method in the extern file?
like, a factory method
Is there a pattern for non-protocol-defined methods on deftypes ? For cases where only one kind of deftype has the method..
every method on a deftype must come from a protocol or interface
@minikomi in CLJS you can actually just do (deftype Thing [x] Object (foo [this] ...))
(.foo (Thing. :x))
oh, I had no idea
experimenting with doing some 2d stuff in the browser using cljs.. currently abusing deftype as an alternative to dropping down to js objects to avoid GC with a lot of updates each frame
a meetup on this Thursday in Singapore https://www.meetup.com/Singapore-Clojure-Meetup/events/240601551/
Hey, so if I successfully compile my cljs app with target being nodejs meaning it can then be used as a node lib what’s the way to go about making it a node lib that can be installed with yarn/npm
@urbanslug docs are still sketchy but it isn’t hard to do https://github.com/thheller/shadow-cljs/wiki/ClojureScript-for-node.js-libraries
Was playing with clojurescript datastructures for use as queues (fifo or lifo), so I made this table to visualize the differences: https://gist.github.com/pesterhazy/4dac98a570b9534e56cace78b945bc62
Does anyone have experience with async tests in cljs.test? I am struggling to get this simple test working:
(deftest async-test
(async done
(let [result (atom nil)
foo (chan)]
(go
(>! foo 123)
(reset! result (<! foo)))
(time/sleep 1000)
(is (= 123 @result)))
(done)))
Following instructions here https://github.com/clojure/clojurescript/wiki/Testing#async-testing
@dnolen time/sleep
is
(defn sleep [msec]
(let [deadline (+ msec (.getTime (js/Date.)))]
(while (> deadline (.getTime (js/Date.))))))
If I used an async timeout would that work ?(deftest async-test
(let [result (atom nil)
foo (chan)]
(async done
(go
(>! foo 123))
(go
(reset! result (<! foo))
(is (= 123 @result))
(done)))))
I'd like to implement eval-sexp
in AceEditor, for cljs project. Does someone know if this has already been implemented somewhere, just trying to save time.
Basically just select beginning and end parenthesis of s-exp that the cursor is placed at, at any given moment.
Are there some common errors that cause the browser to go "SyntaxError: expected expression, got ')' [learn more] void();:1:5"? There's no hand-written js code in my project, it's all cljs.
Ok. I guess I'll keep trying stuff. Weirdly enough, I get that message, but it doesn't break anything. Maybe it's in a js dependency...
Safari, Chrome, Firefox all can give slightly different, and slightly more useful errors depending on the case
also try clearing your lein cache (if you're using lein) and try a different browser (to avoid weird browser caching issues)
looking for recommendations for a library to use to do Capybara-style tests that drive the browser.