This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-12-02
Channels
- # adventofcode (286)
- # aws (3)
- # beginners (243)
- # calva (4)
- # cider (51)
- # cljs-dev (8)
- # clojure (74)
- # clojure-conj (1)
- # clojure-france (1)
- # clojure-italy (1)
- # clojure-spec (21)
- # clojure-uk (22)
- # clojurescript (25)
- # clojurex (6)
- # code-reviews (5)
- # core-async (3)
- # cursive (1)
- # defnpodcast (1)
- # fulcro (29)
- # mount (1)
- # off-topic (85)
- # onyx (5)
- # other-languages (7)
- # pathom (6)
- # pedestal (6)
- # re-frame (20)
- # reagent (2)
- # reitit (8)
- # ring-swagger (10)
- # shadow-cljs (53)
- # spacemacs (8)
- # tools-deps (34)
Using core.async, would it be better to return a channel from a function or pass one in?
If passed in the caller has more control, they can put transducers on the channel or close it whenever.
return by default, optionally pass in, here is an example from a recent cognitect lib: https://youtu.be/ppDtDP0Rntw?t=1783
It returns the ascii-codes in clojure (97 98 99 100 101)
. Weird.
cljs dont have char
type
I have a branch with a (deftype Character [c])
but there is a lot of problems with cljs
implementations (for example, cljs.pprint) that expect the return of (first string)
to be a string
Yeah, there is likely a lot of code in the wild too. My suspicion is that this can't be done as a non-breaking change.
Excuse me, I am currently learning making PWA using reagent, but I have a trouble when checking the service worker.
How do I convert (javascript)
if ('serviceWorker' in navigator){}
into Clojurescript?
I tried using
(when (in 'serviceWorker' js/navigator))
but it throws error that in
is not avaiable
(when (contains? js/navigator "serviceWorker") ...)
It works but it returns wrong value It should returns true (I tested in Chrome)
You can do (.-serviceWorker js/navigator)
- it'll be nil
in browsers without that feature
Is deftype
portable Clojure, especially when using mutability?
deftype
in ClojureScript works essentially like it does in Clojure. In particular ^:mutable
is supported on fields.
👋 Hi everyone! Is there something I need to be aware of in terms of keeping a function alive across calls in JS land? In this example, I'm trying to cache the last value, which works when I'm in the REPL/development, but when I release compiled js (on NPM) and import it, it never hits the cache...
This is just a toy example... I have to coordinate API calls across multiple APIs in a specific order
Anyone know of any open source Clojurescript + Reagent projects that make for good studying? I'm specifically trying to find a few larger(ish) projects which use core.async that I could dig into and learn from.
not Reagent but om: Circleci's frontend: https://github.com/circleci/frontend Might make a good study for general clojurescript architecture
also, this search might help you to find more of them: https://github.com/topics/clojurescript?o=desc&s=stars seems it's mostly libraries though, but LightTable/LightTable seems application-ish enough to qualify as well