Questions tagged [om]

A ClojureScript interface to Facebook's React.

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


Documentation

139 questions
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,961
  • 2
  • 36
  • 40
3
votes
1 answer

om - data not updating after ajax call

I have the following code and I think I am doing something fundamentally wrong. (defn world-view [data owner opts] (reify om/IInitState (init-state [_] (om/update! data #(assoc % :world vec))) om/IWillMount (will-mount…
dagda1
  • 26,856
  • 59
  • 237
  • 450
3
votes
1 answer

Replaying an Om web session(Clojurescript)?

I would like to make an Om session from Clojurescript which can reply the whole GUI on another machine. How can I pass the atom from client to server so that only the changes are sent, so that the history of changes can be replayed somewhere…
yazz.com
  • 57,320
  • 66
  • 234
  • 385
2
votes
1 answer

Deriving static CSS from React components in ClojureScript

I've been playing around and thinking about using React through its various abstractions in ClojureScript, Reagent, Rum, Re-frame and Om. But there's one thing that I'm not sure that either adresses, perhaps because its a separate concern depending…
Rovanion
  • 4,382
  • 3
  • 29
  • 49
2
votes
1 answer

omcljs basic tutorial giving error: Uncaught Error: Assert failed: No target specified to om.core/root (not (nil? target))

I am attempting om's basic tutorial, and run into an error even before changing any code. I followed the instructions, running lein new figwheel om-tut -- --om, cd om-tut, and lein figwheel. http://localhost:3449/ then displays the html text, not…
mherzl
  • 5,624
  • 6
  • 34
  • 75
2
votes
1 answer

Clojure om next multiple print-method exception

I am trying to build server-side rendering for om.next (1.0.0-alpha47). At some point I have to create a reconciler from Clojure: (om/reconciler {}) (om/reconciler {:state (atom {}) :normalize true :parser (om/parser {})}) However…
nha
  • 17,623
  • 13
  • 87
  • 133
2
votes
1 answer

Om Next tutorial: Components Identity Normalization -- om/db->tree usage

The Components, Identity & Normalization Om Next tutorial says to evaluate some om.next/db->tree calls at the REPL to understand normalization. The tutorial has two components, Person and RootView. Person implements om/Ident. Calling (om/tree->db…
2
votes
2 answers

om/react: manipulate elements outside the render target element

I'm using om as a clojurescript react interface. One question, which I guess relates to both om and react: Inside my html body I have a div of the id "app", which is used for om/react as a render target. What would be a prefered way to change…
Anton Harald
  • 5,772
  • 4
  • 27
  • 61
2
votes
1 answer

OM how to add class to html element

Trying out OM, ReactJS and ClojureScript. I am trying to add a classname to my dom element. Ideally I want something like this:
Contact list
right now: It writes like:
Contact…
Coding Enthusiast
  • 3,865
  • 1
  • 27
  • 50
2
votes
1 answer

ClojureScript google closure code splitting partial loading

I'm coming from a javascript/react/react-router/webpack background to a clojurescript/om environment. With webpack & react-router it was possible to split my code and only load the javascript needed. E.g. on /login I would only load the js necessary…
Seneca
  • 2,392
  • 2
  • 18
  • 33
2
votes
1 answer

laying out button group in a ClojureScript om-bootstrap navbar

I'm trying to include a button group in the navbar of a ClojureScript application in which I'm using om-bootstrap, but the layout isn't coming out right --- it's like the button group is interrupting the navbar's layout flow. What I'm getting looks…
embeepea
  • 637
  • 1
  • 6
  • 12
2
votes
1 answer

Removing Reactjs Om components (ClojureScript)

I am trying to make a tabbed windowing system within a webpage using om-bootstrap's "pills" navigation by adding tabs when links get clicked and removing tabs when an X button on the tabs is clicked. I need to know how to add and remove data from…
user2491
  • 83
  • 4
2
votes
1 answer

Updating an OM cursor that went through a function

When calling om/build, one can send an fn option, which according to the documentation: `fn - a function to apply to x before invoking f.` My question is, when applying om/transact! or om/update! to the cursor (x) that was manipulated by the fn,…
Asher
  • 1,267
  • 1
  • 12
  • 24
2
votes
2 answers

Can't update state with transact! in Om

In the local-state example in the om-cookbook, I'm able to update the counter using update-state! and set-state!, but not with transact! I initialized project using chestnut template. (def app-state (atom {:button-presses 0})) These work (defn…
Kao Nashi
  • 265
  • 2
  • 9
2
votes
1 answer

How can I get the DOM element from an Om DIV?

I am using Clojurescript Om and I need to access the underlying DOM element (so that I can set offsetTop to 0) on one of the DIVs contained in a component. How can I get access to this element?
yazz.com
  • 57,320
  • 66
  • 234
  • 385