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
2
votes
3 answers

How do I run ClojureScripts Om on Node.js?

I'm trying to work out if I can use Om on Node.js to generate HTML. I've been able to get ClojureScript running on Node.js and apparently React can be run on Node.js. I create a Leiningen project as follows as per the basic guide lein new figwheel…
Hugh Powell
  • 317
  • 2
  • 11
2
votes
1 answer

How do I start a repl inside of a ClojureScript page?

I have a single page application that consists of 4,000 lines of ClojureScript. The page is served up from a Clojure Web Server and is running inside of my browser. What I want to do is to start a REPL inside of my page and connect to it from…
Chaos Rules
  • 410
  • 1
  • 3
  • 14
2
votes
4 answers

Using Om, Generate Nested divs From a Nested Map

Say I have the following map: (def m {"a" {"d" {} "e" {}} "b" {"f" {} "g" {"h" {} "i" {}}} "c" {}}) I need to render it like this: (om.dom/div #js {} "a" (om.dom/div #js {} "d") …
user3594595
2
votes
2 answers

Conditionally Add a Class to an Element with Om

In Om, is there a way to add a class to an element based on some value in the main app atom? Take the following element, for example: (defn some-component [app owner] (reify om/IRender (render [_] (html [:div {:class…
user3594595
2
votes
1 answer

How to use Hickory with Clojurescript (OM/Reagent)?

In my Reagent project, I'm parsing HTML with Hickory and rendering a Hiccup page. The hiccup is rendered. But when I change the page (!reset my view atom), React.js goes crazy because Hickory has generated: [:div (as-hiccup (parse "

HELLO…

hzhu
  • 3,759
  • 5
  • 29
  • 39
2
votes
1 answer

om get-props vs get-state

I am trying to grasp the purpose of the two OM functions get-state and get-props. Have a look at the following example: (defn example [app owner] (reify om/IInitState (render-state [this state] (println "app-state: " app ) …
shaft
  • 2,147
  • 2
  • 22
  • 38
1
vote
1 answer

How to toggle class on a dom element using clojurescript or om-next

I'm new to clojurescript and I got a task of creating a filter with toggling list items requirement on click of a plus icon. I have written css to hide when the class is inactive and show when it's active. I just want to know the correct syntax how…
1
vote
1 answer

Is there a Cordova plugin for OM SDK?

The IAB has a new SDK for measuring viewability in app, and they have launched the OM SDK. Do you know if there is a Cordova plugin for this or if maybe are there plans to develop it? Here is the IAB article refering to OM…
1
vote
0 answers

Example application Om next

is there any small example application in On next with GraphQL backend (few pages, queries and mutations)? I'm doing presentation about Sangria (Scala GraphQL server library) and I want some frontend for it. And also I'm curious about Om for longer…
user1698641
  • 211
  • 1
  • 12
1
vote
1 answer

Resolving foreign keys in Om Next

I'm trying to understand the normalization, identity and querying concepts in Om Next. Every time I think I have it, I run into a new situation that seems to baffle me. I have a remote that returns the following data: {:users [ {:id 1, :email…
Linus
  • 1,113
  • 1
  • 8
  • 14
1
vote
1 answer

Error while compiling clojurescript with om-tools.dom

Trying this Om & React tutorial https://www.codementor.io/reactjs/tutorial/build-single-page-app-with-react-om-clojurescript . When compiling clojurescript I get an error clojure.lang.ExceptionInfo: Don't know how to create ISeq from:…
eax
  • 11
  • 2
1
vote
0 answers

nested comments with Clojure in om.next

Om.Next is an excellent and clean UI library for use with Clojure and Clojurescript and I'm trying to add functionality for commenting to our website. Essentially: entities have a bid (blurb-id) and now I want to add comments. My idea is: entities…
sova
  • 5,468
  • 10
  • 40
  • 48
1
vote
1 answer

Om Next subquery doesn't have effect on sub component props

Reading this Om Next tutorial page Components, Identity & Normalization, I thought the subquery from the subcomponent (Person component) is used to populate the Person's props. But changing the query from '[:name :points :age] to '[] doesn't break…
H. Jeon
  • 11
  • 1
  • 3
1
vote
1 answer

Should "component" functions in Om be called directly?

As I'm only starting to fully understand, om.core/build and om.next's factory functions return React element objects, which refer to component functions/classes, and the actual component is only instantiated later by React's reconciler. That is,…
Peeja
  • 13,683
  • 11
  • 58
  • 77
1
vote
1 answer

Accessing om.next sub-component state

I'm just picking up om.next and have run into a situation where I've got some form inputs realized as components which hold on to local state, e.g. validation state, actual input value, etc--this state is updated and accessed via…
maxcountryman
  • 1,562
  • 1
  • 24
  • 51