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
6
votes
1 answer

Differences between :init-state vs :state at build function

I understand that you can initiate the state of a component by passing a map as the value of the :init-state keyword. But by passing this map as the value of the :state keyword, for example, between a component and its child component, now they can…
roboli
  • 1,418
  • 20
  • 24
6
votes
1 answer

Problems getting recursive component working in Om?

I have the following: (ns commentz.client (:require [om.core :as om :include-macros true] [om.dom :as dom :include-macros true] [clojure.browser.repl])) (def app-state (atom {:id "a" :value "I am the greatest of…
Stephen Cagle
  • 14,124
  • 16
  • 55
  • 86
5
votes
3 answers

Should I learn React Before Learning Clojurescript Om?

I'm going to learn Clojurescript for building UIs and I want to use the React wrapper.Should I learn React before diving into Om?
Ertuğrul Çetin
  • 5,131
  • 5
  • 37
  • 76
5
votes
1 answer

Clojure — Meaning of pound symbol?

In the Om Next Quick Start, they use #js and #uuid. What does the pound symbol here mean? Link: https://github.com/omcljs/om/wiki/Quick-Start-(om.next)#components-with-queries--mutations Snippets: #js: (defui Counter static om/IQuery (query…
FeifanZ
  • 16,250
  • 7
  • 45
  • 84
5
votes
1 answer

How Query Composition With Unions works with parent children tree passed via props in Om Next

I have two components A and B. I want to switch between these two components on the page. (defui A) (defui B) One solution is to use a parent component C: (defui C (render (let [{:keys [activeView]} props] (if (= activeView 'A') …
eguneys
  • 6,028
  • 7
  • 31
  • 63
5
votes
1 answer

cljs Om interop with React components?

Is it possible to use third-party React components in an Om application? I have a project written in ClojureScript with Om and I would like to use JedWatson/react-select, how should I approach this problem?
Victor Marchuk
  • 13,045
  • 12
  • 43
  • 67
5
votes
1 answer

How do persistent data structures help make Om faster

Om, the clojurescript wrapper of React, is said to be very fast because it leverages immutability. I can't understand how persistent data structures can help here. What I have understood is that application state is an atom. This state is passed to…
agori
  • 481
  • 6
  • 14
5
votes
1 answer

How can I parse string into Hiccup?

How can I parse a string of Hiccup into a Hiccup node? For example, "[:b 'hello world']" into [:b "hello world"]
hzhu
  • 3,759
  • 5
  • 29
  • 39
5
votes
2 answers

Cojurescript Om: handling local state changes in different components

I am building an om based form were subsections may be viewed either collapsed or expanded. The view status is saved in the subsections local state: (defn subsection-view [subsection owner] (reify om/IInitState (init-state [this] …
naomi
  • 2,583
  • 2
  • 22
  • 39
5
votes
2 answers

Cannot manipulate cursor outside of render phase

Trying react for the first time, and I want to make a simple todo list app. But every time I press enter to trigger onSubmit it says Uncaught Error: Cannot manipulate cursor outside of render phase, only om.core/transact!, om.core/update!, and…
Faris Nasution
  • 3,450
  • 5
  • 24
  • 29
4
votes
0 answers

CSS Modules in reagent and/or om

While this is probably a very silly question, is there a canonical way to use css modules in either Reagent or Om components? By this I mean CSS written in a separate file in SCSS or CSS without writing styling in EDN like garden.
Ethan McCue
  • 883
  • 1
  • 8
  • 17
4
votes
1 answer

Mixing Pure React Components with Om Next

Suppose I have access to a pure react.js component via some library: var MyPureJavaScriptComponent = React.createClass({ render: function() { //... } }); But I wish to use om.next, where React components are constructed via the defui…
George
  • 6,927
  • 4
  • 34
  • 67
4
votes
1 answer

Clojure(Script) Static Protocols?

The ClojureScript library Om Next makes use of a static protocols. I have never seen this before and am wondering if it's an Om specific concept, or an actual part of the language. Here is a simplified down code snippet: (deftype type static…
George
  • 6,927
  • 4
  • 34
  • 67
4
votes
3 answers

Om-next Remote Sync Tutorial send-to-chan

I am probably doing something wrong but I believe one of the om-next tutorials has some issues; specifically the autocomplete example. I was able to figure out one of the issues but there is another issue that is causing me some problems. Once I…
user2517182
  • 1,241
  • 3
  • 15
  • 37
4
votes
1 answer

Om Next Tutorial: Correctly calling the get-people function

I'm currently following along the om-next tutorial. In the Adding Reads section, there's a function get-people is defined. Along with this function, the init-data map is defined that contains a list of people. (defn get-people [state key] (let [st…
Kurt Mueller
  • 3,173
  • 2
  • 29
  • 50
1
2
3
9 10