Fork me on GitHub
#re-frame
<
2017-07-14
>
mikethompson01:07:35

It is a real delight for me to see a steady trickle of job descriptions mentioning re-frame. Here are two current ones: http://workinstartups.com/job-board/job/59443/senior-clojure-engineer-at-entrepreneur-first/ https://angel.co/compute-software-2/jobs/255910-clojure-clojurescript-engineer Knowing re-frame might actually help you to get a nice job these days!!

mikethompson04:07:08

I have just bashed out a quick update to the testing doc: https://github.com/Day8/re-frame/blob/master/docs/Testing.md It probably contains typos. Any extra eyes on it, with fixes would be appreciated.

mccraigmccraig07:07:17

another job description with re-frame for your fridge @mikethompson https://www.yapster.info/jobs-developer from my company šŸ˜„ (though we already filled this position)

pesterhazy09:07:03

I often get warnings like this when using re-frame on react-native: <Warning>: 're-frame: overwriting', ':event', 'handler for:'

pesterhazy09:07:13

after reloading with figwheel. Am I doing things wrong, or is that normal?

pesterhazy10:07:27

it's more obvious on react-native because console.warn triggers a very loud Yellow Box on the bottom of the screen

mikethompson10:07:36

Yeah, when figwheel reloads the file, all the registrations in that file are redone. But re-frame can't be sure if reregistering a handler is a bug or not

pesterhazy10:07:39

so the case you want to catch is where there are multiple event handlers for the same key, perhaps in different namespaces?

mikethompson11:07:01

@danielcompton did get someway towards a solution. https://github.com/Day8/re-frame/pull/254 Can't remember why we left it.

mbertheau13:07:52

How do I fire an event on "load complete"? I want to focus the main input field when the browser is ready.

souenzzo18:07:19

"When the component is rendered": https://facebook.github.io/react/docs/refs-and-the-dom.html "When the page finishes to load" window.onload = (e) => {}

souenzzo18:07:32

But sure, on "input", it's autofocus props

sandbags13:07:58

lein ancient tells me that reagent 0.7.0 is available (I am using 0.6.2). Is that compatible with re-frame 0.9.4 ?

mbertheau13:07:31

@burke That's nice! Thanks šŸ™‚

mbertheau13:07:00

Hmm, I can't get the autofocus attribute in the HTML. [:input {:auto-focus true :type "text"}} doesn't do it - that just renders as <input type="text">.

burke14:07:44

in html it is expected that autofocus does not have a value. But in xhtml standard it should have the value "autofocus", so maybe you try {:autofocus "autofocus" :type "text"}

mbertheau14:07:06

Ah. I was expecting the autofocus attribute to appear in the HTML, but actually React handles it, and :auto-focus true works fine.

burke14:07:46

okay šŸ™‚

sandbags14:07:14

@mbertheau was that reply to me?

mbertheau14:07:40

@sandbags Yes, re-frame 0.9.4 is compatible with reagent 0.7.0.

danielcompton22:07:40

But it didnā€™t go too far

lwhorton23:07:06

anyone have experience pushing reframe /cljs in general really hard? like .. how abusive can you be about reactive flowing data before you start to miss frames?

ajs18:07:13

I've pushed Om really really hard and never hit a performance bottleneck

ajs18:07:29

I would expect the same from reagent, and even better performance from reframe

lwhorton18:07:34

thatā€™s good to hear. I guess I will find out how well reframe does. iā€™m essentially doing a O(n^2 * 4) every time thereā€™s a change in any of 4 collections

lwhorton18:07:20

but the implementation of the brute-force approach is about 4x less complex than any other way I can think of šŸ™‚

lwhorton23:07:55

iā€™m wondering if I could do a ā€œtrue frpā€ approach with this feature iā€™m developing.. where I have two sets of base data, and two sets of ā€œstateful dataā€ that I apply on top each time any of the 4 sets change

Doug Kirk23:07:02

If I'm understanding correctly, you can use Reagent's track to merge base- and state- data and have it look like a ratom:

(defn combined-data
  []
  (let [base @(rf/subscribe [:base-data])
        state @(rf/subscribe [:stateful-data])]
     (merge base state)))

...

(let [combined (r/track combined-data)] ...)
in which combined is a ratom with the merged data.

lwhorton23:07:18

I think my problem is I want this magic to happen without someone having to deref in that (let [combined ...? though now that you mention it i can just deref inside a subscription, maybe. after hours of experimenting the timing seemed a little iffy and felt more and more like a hack