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

ClojureScript/Om: Rendered HTML is missing attributes

I have a dead simple ClojureScript/Om application. It seems a little broken. This is the core file: (ns demo.core (:require-macros [cljs.core.async.macros :refer [go]]) (:require [goog.events :as events] [cljs.core.async :as async…
Sir Robert
  • 4,686
  • 7
  • 41
  • 57
1
vote
1 answer

ClojureScript & Om: Best practice for writing document.hash

I have a "Hello, World!" app in ClojureScript using Om (generated from the "Chestnut" lein template). The goal is to have it set up such that: The document.location.hash value reflects changes to the (:route app-state) vector. The (:route…
Sir Robert
  • 4,686
  • 7
  • 41
  • 57
1
vote
1 answer

Having trouble correctly manipulating state in Om app

I'm having trouble manipulating state in an Om app. Specifically, I can't figure out how to remove items from a list. Here's a demonstration of my folly. It's a simplified app that's broken. https://gist.github.com/rerb/29d10959e71ba1e31e8e Two…
rerb
  • 65
  • 7
1
vote
2 answers

When I refresh my Reagent page, Firebase data isn't available so I get an exception

I've a Reagent that works on all pages while clicking back & forward buttons. However, it throws an exception when a page is REFRESHED. My app fetches data from Firebase and sets an atom. Then as the UI is rendered. The view grabs data from the atom…
hzhu
  • 3,759
  • 5
  • 29
  • 39
1
vote
2 answers

How to turn text into DOM elements using Clojurescript? (And Om?)

In a ClojureScript/Om app, I have a DOM and a string of HTML. How can I translate that string of HTML into elements I can insert into the DOM? I've started down the path of parsing the HTML with hickory, planning to then process the hickory data to…
rerb
  • 65
  • 7
1
vote
2 answers

om ClojureScript ref-cursor error when trying to update vector using om/transact

I am seeing the following error when trying to update a cursor: Uncaught Error: No protocol method ITransact.-transact! defined for type function: function comments(){return om.core.ref_cursor.call(null,new…
Mike Wilcox
  • 188
  • 2
  • 9
1
vote
1 answer

using core.async / ajax data in om component

I am currently experimenting with om and try to load external data for displaying it in a component. My detail component: (defn detail-component [app owner opts] (reify om/IInitState (init-state [_] (om/transact! app…
patchrail
  • 2,007
  • 1
  • 23
  • 33
1
vote
1 answer

How to call om.dom/render-to-str in Emacs nrepl?

I would like to display the html output of the following object: (defn search-input [_ owner] (reify om/IInitState (init-state [_] {:text nil}) om/IRenderState (render-state [this state] (dom/input #js {:type…
rogergl
  • 3,501
  • 2
  • 30
  • 49
0
votes
1 answer

Receiving the instance of a already called module in another file without calling it again

I have a question concerning variables and passing them to class methods. I have a script OM with the class OM in it. class OM: def __init__( Self , Debug_Mode = False ): print( "Initialized" ) Self.Debug_Mode = Debug_Mode …
NumeroUnoDE
  • 37
  • 1
  • 8
0
votes
1 answer

Test if Clojure Om Next component satisfies? a protocol

In Clojure (not ClojureScript), how can I check that a given component implements a protocol? (defui MyComp static my-protocol (aaa [this] [])) (satisfies? my-protocol MyComp) ;; false (satisfies? om.next.protocols/IReactChildren MyComp) ;;…
nha
  • 17,623
  • 13
  • 87
  • 133
0
votes
0 answers

Secretary Routing, Ident Query in om.next

I will preface this question by saying I am still very much a novice when it comes to Clojure/Script, so besides the very pointed question I will pose any general feedback about style, usage would be greatly appreciated. I have been building a very…
Colin Teal
  • 1
  • 1
  • 2
0
votes
1 answer

Why doesn't my query get passed into my reader?

Questions My webpage only has the output: {:user {}} with the following code. (ns omn1.core (:require [om.next :as om :refer-macros [defui]] [om.dom :as dom :refer [div]] [goog.dom :as gdom])) (defui MyComponent static om/IQuery …
ftravers
  • 3,809
  • 3
  • 37
  • 38
0
votes
1 answer

Updating nested state in Om.next

I am having problems with updating state with data from input fields in Om.next. Reading state in Om.next is solved by queries and queries enable components to implement fetching state independent of context, which is great, as that means the…
RokL
  • 2,663
  • 3
  • 22
  • 26
0
votes
1 answer

Om Formatted Text Input Component Cursor Jumping

(I'm a little new to OM and React, so apologies if this is documented somewhere that I haven't seen yet.) I'm trying to make a textbox that validates and formats its input during editing similar to the autoNumeric JS library. My application is for…
dsg
  • 12,924
  • 21
  • 67
  • 111
0
votes
2 answers

Using the reconciler to test query in Om Next

Im sure I have read somwhere how it is possible to use the reconciler to test query expressions in Om Next directly but im not able to find the source again or figure out if this is possible based on the Om documentation. Is this possible to do so…
user3139545
  • 6,882
  • 13
  • 44
  • 87