Questions tagged [clojurescript]

ClojureScript is a dialect of Clojure that compiles to JavaScript.

ClojureScript is a dialect of that compiles to . ClojureScript's compiler is designed to emit JavaScript code which is compatible with the advanced compilation mode of the .

For more details, please visit the project website.

2300 questions
1
vote
3 answers

Clojure - close over a function in another namespace

Let's say that I have the following : (defn my-fn [params] (make-things (a-fn [ctx] (do-this params))) Now I wish to split this into different files, such that a-fn is in another namespace : (defn my-fn [params] (make-things…
nha
  • 17,623
  • 13
  • 87
  • 133
1
vote
1 answer

Using Clojurescript thread-first macros with Javascript Interop

Is it possible to use the "thread-first" macro if any of the required forms are part of a Javascript interop? For example, if you wanted to group inputs in ranges of size 10, you might have something like the following: (defn get-size [i] (-> i …
duncanhall
  • 11,035
  • 5
  • 54
  • 86
1
vote
1 answer

description event getting nil in riemann

I am trying to send email alert from logstash using Riemann. My email should get triggered on meeting certain criteria. I wrote Riemann config to send email alert for that I am sending certain events from logstash, I have hardcoded :description…
Mangoski
  • 2,058
  • 5
  • 25
  • 43
1
vote
1 answer

Using cljs-ajax to send an array as param in a GET call to a ring backend

I'm making a GET call to a ring backend using cljs-ajax. The problem is that I need to pass an array too. cljs-ajax encodes array like this: ?array[0]=one&array[1]=two ring expects arrays to be encoded like this: ?array=one&array=two So using the…
Dario Oddenino
  • 1,294
  • 2
  • 9
  • 15
1
vote
1 answer

Can't set CSRF Token when using Ring reload

Currently setting up CSRF token for POST requests with Ring. I've been following answer to this question as a guide Set Ring-Anti-Forgery CSRF header token. After following this guide I am able to successfully get the csrf token and send a POST…
1
vote
1 answer

How to do a release/deploy build of a clojurescript app?

I'm ready to release my clojurescript app. Currently i do lein ring uberjar to create my jar, which does build cljs, but i dont see any documentation on how to do a release build-- do i need to do any concat-ing/minifying/bla bla bla? Are there…
Micah
  • 10,295
  • 13
  • 66
  • 95
1
vote
1 answer

Does (into) do any higher-level inference to stay idiomatic on output type?

Say I have a key-value pair I've agnostically defined as a key-value map: (def foo {:bar "baz" :bat "squanch"}) It occurs to me at some later time to do some set operations on it, so I'll need to convert it to a relation, which the Clojure…
bright-star
  • 6,016
  • 6
  • 42
  • 81
1
vote
2 answers

Is there a richer BREPL for ClojureScript?

E.g., the equivalent of pry over IRB in Ruby. The BREPL provided when you run lein figwheel doesn't even support command history (^P, ^[[A) or minimal emacs-type bindings such as ^A or ^E for beginning-/end-of-line. These are pretty minor at first…
bright-star
  • 6,016
  • 6
  • 42
  • 81
1
vote
2 answers

Why does reagent not re-render my reagent-form on a state change

I need to create a form containing a select field where the options depend on the currently available mail accounts. I retrieve these mail accounts in a API request after the page has loaded. The following function creates the form with the select…
Kungi
  • 1,477
  • 1
  • 18
  • 34
1
vote
0 answers

Testing core.async code in ClojureScript

I'm trying to test some core.async code, but I'm having trouble writing tests. All of my test code is in a go block, but it seems like the process my test is on isn't parked in the way I expected it to be. After I do the put on the actions channel,…
1
vote
1 answer

Reagent build without minified React library

I would like to get a more helpful exception that this one: Uncaught Error: Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings. I am trying to build a Reagent app without the…
Chris Murphy
  • 6,411
  • 1
  • 24
  • 42
1
vote
2 answers

How to quickly re-load the new code for a ClojureScript library I'm developing?

I have a project using Figwheel with ClojureScript and I'm developing a ClojureScript library. My cycle involves modifying the library, installing with lein install and then using it from the app. The last part is the one I'm not sure about. Nothing…
Pablo Fernandez
  • 279,434
  • 135
  • 377
  • 622
1
vote
3 answers

Clojure: how to get from a map using a string key

If I have a map like this: (def foo {:bar "foobar"}) And I've been passed the key :bar as a string (i.e. ":bar") I want to be able to access the value from the map doing something like (get foo (symbol ":bar")) which I thought would work, because…
stukennedy
  • 1,088
  • 1
  • 9
  • 25
1
vote
1 answer

ClojureScript : How to access an object in an Om cursor

I'm just experimenting with Om, learning from the basic tutorial. My program data is in a single atom : app-state. If I put a sequence into that atom, eg. (defonce app-state (atom {:things [1 2 3 4]})) Then later on, in my rendering, I can get a…
interstar
  • 26,048
  • 36
  • 112
  • 180
1
vote
1 answer

Clojure - core.async vary-meta

I have seen code like this in ClojureScript repeatedly : (apply async/put! port (vary-meta val assoc :key *val*) args) I don't understand the repeated use of vary-meta along with async/put!, why is it needed ? Seen for instance in CircleCI frontend…
nha
  • 17,623
  • 13
  • 87
  • 133
1 2 3
99
100