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
1
vote
1 answer

revealing a hidden div using om (/react)

Using Om, I've set up a component that I want to reveal when a user presses a button. The effect should be that the div slides in from the right. What is the best way to structure this in am Om project? I can't do something hacky like: (let [the-div…
clo_jur
  • 1,359
  • 1
  • 11
  • 27
1
vote
2 answers

om.next: how to have multiple components that use the reconciler

I'm new to om.next (and to clojurescript), and I have the following question. I can only get the root component to be invoked with the reconciler (i.e. have its query method invoked); every other component seems to need to be invoked with props and…
Robert Balicki
  • 1,583
  • 2
  • 16
  • 24
1
vote
1 answer

Why do I get "No protocol method INotify.-notify!" when calling update! or transact! on a cursor?

When using om, (prior to om-next), I am getting an error when attempting to make updates outside of the render phase: cljs.user=> (require '[om.core :as om :include-macros true]) cljs.user=> (def state (atom {:foo {:bar…
Steven Oxley
  • 6,563
  • 6
  • 43
  • 55
1
vote
1 answer

What is an Om component?

Consider the following snippet of om code: (fn [data owner] (reify om/IRender (render [_] (dom/p nil (:text data))))) Question: Is the "Om component" this entire snippet, or is it merely the function's return value of the…
George
  • 6,927
  • 4
  • 34
  • 67
1
vote
2 answers

Om.next: apply vs directly passing children

In the Om.next wiki, there is example code like this (code listing at the bottom of the linked page): (apply dom/ul nil (map person list)) Since dom/ul takes a variable number of arguments, what is the benefit of using apply vs this: (dom/ul…
FeifanZ
  • 16,250
  • 7
  • 45
  • 84
1
vote
2 answers

Writing a structured Om application with requests, but not om.next

I'd like to write an application in Om - a GitHub issues viewer in particular. To retrieve issues from GitHub, I'll need to XHR request them, and there'll be the action of marking issues as 'viewed' by sending a request back to GitHub. There's quite…
tmcw
  • 11,536
  • 3
  • 36
  • 45
1
vote
1 answer

om.next sablono render nested elements in a button

Using om.next and sablono, I am trying to style a button with mdl, as seen there. Here is what I tried in my render method : ;; This works but misses the icon [:input {:type "submit" :className "mdl-button mdl-js-button mdl-button--fab…
nha
  • 17,623
  • 13
  • 87
  • 133
1
vote
2 answers

How do I query with a join getting all the data in Om Next?

In Om Next, when having data such as: {:table {:name "Disk Performance Table" :data [:statistics :performance]} :chart {:name "Combined Graph" :data [:statistics :performance]} :statistics {:performance…
Pablo Fernandez
  • 279,434
  • 135
  • 377
  • 622
1
vote
2 answers

ClojureScript / OM: update a component's state from another component - or: working with global state

I'm getting started with om and ClojureScript with a very simple application. My global app-state looks like this: (def app-state (atom {:animals [ {:name "dog" :img "pic01.jpg"} {:name "cat" :img "pic02.jpg"} …
Anton Harald
  • 5,772
  • 4
  • 27
  • 61
1
vote
1 answer

Including Om Next source

I want to put debugging messages into the Om Next source. So I am wanting to include it in my own project which uses the Om Next library. Mine and Om Next are the two sources. I have put them together (i.e. copied the Om Next namespaces across) into…
Chris Murphy
  • 6,411
  • 1
  • 24
  • 42
1
vote
1 answer

Clojurescript/Reagent handling errors

We are starting to use Clojuescript/Reagent for our next development phase of our product. Basically we need a way, to do a single operation on the atom and we came up with a method like: (def app-state (r/atom {})) (defn select [index] …
Dan Bunea
  • 187
  • 1
  • 2
  • 10
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

Using macros to generate Om components

I'm attempting to use macros to generate a series of similar Om components (e.g. a modal element which contains common boilerplate and a dynamic "body"). I've got the solution below mostly working. The one exception is accessing the appropriate…
pdoherty926
  • 9,895
  • 4
  • 37
  • 68
1
vote
1 answer

Styling Om components

The way to style and Om component is based on how React handles styling. It would be a horrible mess to duplicate common CSS rules all over the application so is there a way to define the styles in a function or similar? (defn my-css [] {:border…
droidballoon
  • 720
  • 10
  • 17
1
vote
1 answer

Render unstanitized HTML with ClojureScript+Sablono

I have a dataset saved in a global atom (as per the typical design pattern in ClojureScript SPA's), and I know that the data is safe (I manually typed it in - its just a list of quotes that I'm rendering randomly one per pageload). However, the…
Ben
  • 574
  • 3
  • 12