This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-07-20
Channels
- # admin-announcements (15)
- # announcements (1)
- # beginners (10)
- # boot (39)
- # bristol-clojurians (2)
- # clojure (146)
- # clojure-canada (1)
- # clojure-gamedev (8)
- # clojure-italy (2)
- # clojure-japan (16)
- # clojure-korea (1)
- # clojure-poland (1)
- # clojure-russia (20)
- # clojure-spain (3)
- # clojurebridge (5)
- # clojurescript (104)
- # core-typed (2)
- # datomic (80)
- # indycljs (1)
- # jobs (1)
- # ldnclj (31)
- # off-topic (15)
- # om (21)
- # onyx (7)
- # ox (9)
- # re-frame (2)
- # reagent (16)
Can anyone faced similar problem? in the sense of making available the owner in the handler, in this case, the on-click
@a.espolov: I don’t have enough information to help you. There’s very little context here.
Widen the scope of the gist, currently too narrow to understand what the problem might be.
In simple terms, om component and html not connected among themselves. From here arises the problem of lack of owner within the scope of the handler, and html
@a.espolov: yes that cannot possibly work because of Clojure(Script) scoping rules period.
owner
doesn’t exist in the global scope, only your component definition scope where you get it as a parameter.
@a.espolov: if you’re unclear about scoping rules I strongly recommend getting a grasp of the language fundamentals first before trying to do anything with Om. Using Om is a bit too far in the deep end of the pool wrt. Clojure(Script) language features.
I'll try to pass to the function owner, and if it comes to js event, on the move to override its about as
let’s say I had a data structure like {:thing {..} :items [{..} {..} {..}]}
, and wanted to render items to a component-list with om/build-all
, and I want to pass in :thing. In React/JSX I’d do {items.map(function(item){ return <Item item={item} thing={this.props.thing} /> }).bind(this))}