Questions tagged [om]

A ClojureScript interface to Facebook's React.

om allows their users to represent data as Extensible Data Notation (EDN).


Documentation

138 questions
4
votes
1 answer

How to merge two #js maps in Om Clojurescript?

In clojurescript when I merge two maps I can do it like this: (merge {:a 1} {:b 2}) How can I achieve a similar thing in Om, where literals are used, something like this (which doesn't work): (merge #js {:a 1} #js {:b 2})
yazz.com
  • 52,748
  • 62
  • 227
  • 363
3
votes
1 answer

Use a different React version with clojurescript react libraries (reagent,om,rum,quiescent)

How can I use a different React version with Reagent, Om, Rum, Quiescent or Brutha?
ClojureMostly
  • 4,460
  • 2
  • 18
  • 24
3
votes
0 answers

Updating Om-Next app state from remote response

I’m a bit confused about updating app state from remote. I’ve made a simulated a remote which responds after some delay on a modified code from https://github.com/omcljs/om/wiki/Components,-Identity-&-Normalization. I simply put random values for…
fifigyuri
  • 5,391
  • 6
  • 27
  • 46
3
votes
2 answers

Om Next read multi-fn not being called in second level join, Query AST not parsed fully, therefore component only receiving idents

I'm having trouble getting a second level join to work correctly. I've elided some things here for brevities sake. My root component is: (defui RootView static om/IQuery (query [this] `[{:list/events ~(om/get-query Event)}]) Object …
3
votes
0 answers

ClojureScript NVD3 full-height shaded intervals

My graphs currently indicate "no data" by calculating the holes in my datasets, then generating a new fake dataset that ranges from nil to max(all-y-values), thus making it look like a full-height background. I make it an "area" dataset and apply an…
tar
  • 1,511
  • 1
  • 21
  • 30
3
votes
2 answers

query function returning value as nil in om.next

I am currently trying to learn om.next. This is the code that I have: (ns hlearn.core (:require [goog.dom :as gdom] [om.next :as om :refer-macros [defui]] [om.dom :as dom] [sablono.core :as html :refer-macros…
lhahn
  • 1,171
  • 2
  • 10
  • 34
3
votes
1 answer

Testing components with async api calls by mocking the request

I'm still in a learning phase for Cljs and Om. I'm looking into writing comopnent test. Some components have cljs-http calls to an API I created. When testing, I do not want those API calls to actually send the request, so I'm looking into mocking…
tolgap
  • 9,133
  • 10
  • 45
  • 63
3
votes
1 answer

Set initial state for missing key in component data

I am trying to get into ClojureScript and Om. There is a specific case which has me running in circles. I have a component that is first rendered without a key. (defn model-view [data owner] (reify om/IWillMount (will-mount [_] …
tolgap
  • 9,133
  • 10
  • 45
  • 63
3
votes
1 answer

How to achieve basic animation in React with Om/Clojurescript (coming from jQuery)?

I am diving into React with Om/Clojurescript, having worked with jQuery for all my frontend work to date, I am at a major roadblock for understanding how to achieve simple and common tasks that are a oneliner in jQuery. Take, for a very simple…
waffl
  • 4,140
  • 5
  • 60
  • 108
3
votes
2 answers

How does Om render list objects?

I'm struggling with understanding how om uses apply to render list items, as shown in the example below taken from the Om tutorial page. (om/root (fn [data owner] (om/component (apply dom/ul nil (map (fn [text] (dom/li nil…
user3139545
  • 5,380
  • 8
  • 30
  • 64
3
votes
1 answer

Clojurescript OM targeting element on different html

So I'm starting to learn clojurescript and I'm checking out different tutorials on it. One thing I wasn't able to find out is to target an element id on a certain html file to put my markups. Let's say I have two html files, index.html and…
Robin Carlo Catacutan
  • 11,461
  • 9
  • 48
  • 79
3
votes
1 answer

How to convert HTML tag with style to Hiccup? React problems

I'm trying to parse HTML with CSS into Hiccup in a Reagent project. I am using Hickory. When I parse HTML with inline CSS, React throws an exception. (map as-hiccup (parse-fragment "
test
") ) The…
Henry Zhu
  • 3,443
  • 5
  • 24
  • 36
3
votes
1 answer

How to invoke .toDateString() on Date object in Clojurescript

I'm trying to get the DateString in Clojurescript: new Date(1420971497471).toDateString(); I am having trouble because (js/Date 1420971497471) returns a string, so I can't call .toDateString(). Here's my Clojurescript code: (.toDateString (js/Date…
Henry Zhu
  • 3,443
  • 5
  • 24
  • 36
3
votes
1 answer

transact app-state in will-mount has no effect

This question can be best explained with an example: ;; create a basic om app. lein new mies-om om-tut lein cljsbuild auto. Then paste in the following code (in core.cljs) (ns om-tut.core (:require [om.core :as om :include-macros true] …
shaft
  • 1,958
  • 1
  • 20
  • 33
3
votes
1 answer

Clojurescript Swap! and multiple assoc-in

Trying to make a piece of code better looking. I have the following in Clojurescript: (swap! app-state assoc-in [:lastresults] []) (swap! app-state assoc-in [:error] false) (swap! app-state assoc-in [:computing] true) Sometimes more. Any idea on…
Nicolas Modrzyk
  • 13,072
  • 2
  • 32
  • 37