clojurescript Questions

3

Solved

How to access things like sin, cos or PI in a pure Clojure way? For example, if I want to write a pure library, I mustn’t use anything like (.PI Math) (Java) or (.‑PI js/Math) (JS).
Littlejohn asked 16/1, 2014 at 11:23

3

I'm trying to make a sleep function in ClojureScript (w/ Reagent): (ns cljweb.webpage (:require [reagent.core :as reagent])) (def temp-atom (reagent/atom 0)) (defn sleep [msec] (js/setTimeou...
Recent asked 31/3, 2017 at 7:10

2

Solved

I've just written some ClojureScript code, only to find out that I couldn't access one of the libraries listed in my project.clj's dependencies. Is this correct, i.e. that you can't use Clojure lib...
Stokehole asked 27/3, 2013 at 13:3

3

Solved

I'm trying to set the initial focus on an input element (defn initial-focus-wrapper [element] (with-meta element {:component-did-mount #(.focus (reagent/dom-node %))})) (defn chat-input [] (fn...
Gourami asked 22/12, 2014 at 12:18

2

Solved

I'm using secretary and reagent. This is my code : (def view (atom nil)) (defn layout [view] [:div @view]) (reagent/render-component [layout view] (.getElementById js/document "message")) (sec...
Stenophyllous asked 14/9, 2015 at 20:12

2

Solved

Context I am building a Node.js library with ClojureScript and shadow-cljs. All development is done with ClojureScript but the build artefact is a NPM package. Example: (ns com.example.answer) ...
Pickaninny asked 23/9, 2019 at 10:52

2

Solved

Let's say I have a cljs file containing the following: (ns foo) (defn add [x y] (+ x y)) and wish to make this available as a JavaScript library to non-ClojureScript devs (primarily focused on ...
Ringer asked 19/10, 2018 at 14:28

5

Solved

When bundling js for React Native using ClojureScript I got the following error. It seems that node runs out of memory when bundling the javascript bundle. This is probably more likely to happen wh...
Frohman asked 5/7, 2016 at 8:21

2

My re-frame views.cljs has: (re-frame/dispatch [::re-graph/init {:http-url "https://api.spacex.land/graphql" :ws-url nil :http-parameters {:with-credentials? false}}]) (re-frame/dispatch [::re...
Oolite asked 18/6, 2019 at 5:18

1

I have a styles.css file and I need to load it from a cljs to pass it as a props to a react lib. The import in node is: import styles from './styles.css' Is it possible to do this in ClojureScri...
Celin asked 22/3, 2019 at 22:11

4

Solved

I'm new to Clojure and I was wondering if there was a way to test if a map has multiple keys. I've noticed that contains? only checks for one key What i'm trying to do: (def mario {:position {...
Vanhook asked 13/1, 2015 at 2:24

3

I have tried to use with-precision but it didn't work: (.log js/console (with-precision 2 1.2345)) So I have used toFixed: (.log js/console (.toFixed 1.2345 2)) But I feel it's not the idio...
Eldoneldora asked 4/2, 2014 at 13:42

1

Solved

There are 3 event fns in Re-frame, I can do the same thing with both reg-event-db and reg-event-fx. What is the main difference between reg-event-db, reg-event-fx and reg-event-ctx? When should ...
Trisect asked 25/2, 2019 at 10:30

3

Solved

In clojureScript the following multi-arity function (defn sum [& xs] (reduce + xs)) can be either called via (sum 4 6 9) or by the use of (apply sum [4 6 9]) which yields the same result. H...
Hyalite asked 20/8, 2016 at 12:9

2

Solved

While defrecord is the preferred form -for the general case- in Clojure for defining an "entity", in ClojureScript one can find far more references to deftype, as reflected in various documentation...
Flanna asked 31/10, 2012 at 2:46

3

Solved

I'm familiar with developing desktop apps in Clojure (written a multithreaded interactive visualization system). However, I'm fairly new to Web development using Clojure. I plan to use Clojure on ...
Checkrein asked 14/4, 2012 at 4:9

4

Solved

I'm writing a client side app. I want to use ClojureScript. I would like to generate vector graphics (graphics, charts, line graphs). What should I read up on? [The only hard requirement is Cloju...
Psittacine asked 26/4, 2012 at 9:18

4

Solved

There are a lot of tools online that take a JSON text and show you formatted and well indented format of the same. Some go even further and make a nice tree-like structure: http://jsonviewer.stack...
Fever asked 24/7, 2013 at 9:4

2

I have an app in ClojureScript, which uses Google's Closure Compiler as a compiler backend. The resulting bundle using advanced optimizations seems way too big for what it is. I blame the dependenc...
Quaquaversal asked 1/10, 2018 at 10:30

3

Solved

I'm trying to setup an environment for Clojurescript. The problem I'm having is not knowing how to set it up so that I can connect to a Clojurescript Browser REPL from emacs, so I can evaluate form...
Thundering asked 18/7, 2013 at 3:38

3

Solved

My Clojurescript app needs to deal with an XML-based API. I know that there are mostly transparent remoting solutions like fetch, but they seem to require that both ends be written in Clojure (i.e....
Ellynellynn asked 20/8, 2012 at 20:50

3

Solved

I am trying to understund this piece of code from Web Development With Clojure book. Its about clojure script: (defn message-form [] (let [fields (atom {})] (fn [] [:div.content [:div.form-...
Auricula asked 18/8, 2018 at 17:11

1

I have a library of functions which I want to let users play with in the browser. So I want to set up a situation like this : I'm developing with figwheel and devcards. In the main core.cljs I r...
Diplomatics asked 28/7, 2018 at 17:52

3

Solved

Why cljsbuild does not compile gulpfile.js file properly? Here is my project.clj config: (defproject cljs-selfstudy "0.1.0-SNAPSHOT" :description "Where I want to learn about clojurescript" :ur...
Biddle asked 12/9, 2014 at 7:55

3

Solved

Is it possible to use arbitrary node.js modules in a clojurescript project? If yes, how do I go about including them? If not, why not?
Gandhi asked 6/6, 2014 at 23:36

© 2022 - 2024 — McMap. All rights reserved.