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…
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…
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…
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')
…
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?
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…
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]
…
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…
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.
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…
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…
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…
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…