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})
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…
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
…
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…
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…
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…
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 [_]
…
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…
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…
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…
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 "
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…
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]
…
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…