Fork me on GitHub
#re-frame
<
2018-07-18
>
jmayaalv10:07:18

has somebody successfully used re-frame-10x with figwheel.main?

jmayaalv10:07:34

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)

danielcompton10:07:48

Open an issue if you can’t get it working

👍 4
Aaron11:07:33

@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?

Aaron11:07:37

Alright cool, that page is making a lot of sense

manutter5111:07:12

I forgot to warn you: re-frame can be addictive once you get the hang of it 😄

Aaron11:07:58

Ha! I got my degree in mechanical engineering, so the logic and separation of components is very welcome

Aaron11:07:13

Especially after trying to learn javascript for some other parts of our project...

martinklepsch15:07:16

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 🙂

👍 12
martinklepsch15:07:51

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

martinklepsch15:07:01

It’s a bit unfortunate that re-frame.core doesn’t have docstrings etc but that has been this way for a while

hoopes20:07:05

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!

sveri20:07:35

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?

kennytilton22:07:10

@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.

kennytilton22:07:28

But I am a re-frame noob.

Tommy23:07:15

hey y'all

Tommy23:07:32

im wondering if anybody knows a way to bind a global keyboard event

Tommy23:07:51

like if I wanted my SPA to have arrow key support like for a game

Tommy23:07:19

is gadfly361/re-pressed the de-facto way? I only need a couple binds, it seems overkill

gadfly36123:07:17

@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) {
    ...
});

gadfly36123:07:01

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