This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-07-18
Channels
- # aleph (4)
- # beginners (70)
- # cider (66)
- # clara (16)
- # cljdoc (20)
- # cljs-dev (9)
- # cljsrn (2)
- # clojure (36)
- # clojure-ecuador (2)
- # clojure-italy (14)
- # clojure-japan (2)
- # clojure-nl (22)
- # clojure-uk (79)
- # clojurescript (133)
- # clojutre (2)
- # code-reviews (5)
- # cursive (5)
- # data-science (1)
- # datomic (47)
- # duct (2)
- # emacs (1)
- # figwheel-main (3)
- # fulcro (11)
- # funcool (1)
- # graphql (6)
- # hyperfiddle (4)
- # leiningen (4)
- # luminus (9)
- # lumo (8)
- # mount (4)
- # nrepl (2)
- # off-topic (19)
- # onyx (1)
- # re-frame (23)
- # reagent (91)
- # reitit (17)
- # ring-swagger (2)
- # shadow-cljs (43)
- # tools-deps (27)
- # vim (45)
keep getting this in the js console
Uncaught TypeError: Cannot read property 'createElement' of undefined
at mranderson048$reagent$v0v8v0$reagent$impl$template$reag_element (template.js:443)
at mranderson048$reagent$v0v8v0$reagent$impl$template$vec_to_elem (template.js:597)
at mranderson048$reagent$v0v8v0$reagent$impl$template$as_element (template.js:610)
at f (dom.js:84)
at mranderson048$reagent$v0v8v0$reagent$dom$render_comp (dom.js:29)
at Function.mranderson048.reagent.v0v8v0.reagent.dom.render.cljs$core$IFn$_invoke$arity$3 (dom.js:86)
at mranderson048$reagent$v0v8v0$reagent$dom$render (dom.js:67)
at Function.mranderson048.reagent.v0v8v0.reagent.dom.render.cljs$core$IFn$_invoke$arity$2 (dom.js:77)
at mranderson048$reagent$v0v8v0$reagent$dom$render (dom.js:63)
at Function.mranderson048.reagent.v0v8v0.reagent.core.render.cljs$core$IFn$_invoke$arity$2 (core.js:169)
@manutter51 reading up more on what you sent me yesterday, and found this page: https://github.com/Day8/re-frame/blob/master/docs/SubscriptionInfographic.md This is what you were describing, right?
Right, yes
I forgot to warn you: re-frame can be addictive once you get the hang of it 😄
Ha! I got my degree in mechanical engineering, so the logic and separation of components is very welcome
I took a stab at setting up re-frame for cljdoc: https://cljdoc.xyz/d/re-frame/re-frame/0.10.5 — any feedback welcome 🙂
The configuration that could be added to re-frame to make this more first-class is here: https://github.com/martinklepsch/re-frame/commit/918cac27f0d8c34ac1630012ca7394a561795b5d
It’s a bit unfortunate that re-frame.core doesn’t have docstrings etc but that has been this way for a while
is the :finally
option from cljs-ajax supported in re-frame-http-fx
? if not directly, is there a good way to support/hack it? (i’m currently dispatching the “final” event from both the success and failure event handlers) … thanks!
What is the idiomatic way to create components. Where do you keep its subs and registered events so they are self contained? All in file?
@sveri I if you make a skeleton app from the lein
template you will see what I see looking at most re-frame apps: different files for db, subs, events, views, etc. I started out trying to keep related events/subs with the components they served, but saw that they were mostly just boilerplate best hidden. I think I ended up keeping interesting sub-elements with their views and dumping the merely boiler plate in files dedicated to their category.
But I am a re-frame noob.
is gadfly361/re-pressed the de-facto way? I only need a couple binds, it seems overkill
@thmorriss You can add an event listener like this and then just handle the keys that you want to for the browsers that you want to support
document.addEventListener('keydown', function(e) {
...
});
re-pressed was to have a consistent way to identity keys with cross-browser support, and enable you to only add a keydown event listener once ... and just hot-swap out the handling function. This second part was useful to me, because i was finding myself adding scattered event listeners and then they would clash on page changes... or get duplicated with figwheel