Fork me on GitHub
#re-frame
<
2016-11-29
>
dragoncube03:11:24

@shaun-mahood is obviously at Conj this week, anyone else?

gadfly36103:11:13

I'll be there

ericstewart03:11:20

I’m mainly a lurker here but have been building my first re-frame side project this year. Will be at the Conj and interested in meeting up and talking re-frame

pesterhazy08:11:17

@motor4k, are you the author of DataFrisk? I love that library

andre08:11:02

i'm author of re-frisk

andre08:11:40

re-frisk uses data-frisk-reagent library for render data structures

andre08:11:18

odinodin is the author of data-frisk-reagent library

pesterhazy08:11:42

I see, 👍 to @odinodin then!

vikeri12:11:51

A question about testing, I try to do with-redefs which works fine as long as i use dispatch-sync in my tests. But when I have a normal dispatch event the redef’ed function goes back to standard. I guess this is due the asynchronous implementation of dispatch under the hood? A question is how people solve that? Would it be solved if I used re-frame-test?

jstaffans15:11:58

what do I have to do to make the re-frame simple example preserve state when figwheel reloads? ie the content of the input gets reset to the default value when figwheel reloads currently. https://github.com/Day8/re-frame/tree/master/examples/simple)

pesterhazy17:11:24

@jstaffans that should work actually

pesterhazy17:11:03

what I'd do is to start debugging where reloading goes off the rails

pesterhazy17:11:12

I'd start by adding logging to the render functions, printing out global state

pesterhazy17:11:32

isolate if global state gets updated incorrectly

pesterhazy17:11:30

the simple example seems a bit too simple also in that it doesn't re-render the root component (there's no on-js-reload fn as far as I can see)

pesterhazy17:11:35

it might be worth copy'n pasting the example into tenzing (or chestnut if you prefer lein?)

pesterhazy17:11:08

I suspect the issue is not to do with re-frame but with reagent or tooling by the way

jstaffans17:11:59

Thanks @pesterhazy, I'll try that out

jstaffans17:11:51

I was expecting something like an on-js-reload function being needed

pesterhazy17:11:19

a couple of other reloading gotchas: - using clojure.core/atom instead of reagent.core/atom - forgetting to use #'component to enable reloading - top-level root component sometimes don't get updated properly; wrap in another component to be sure - "rookie mistake"? https://github.com/Day8/re-frame/wiki/Creating-Reagent-Components#form-1-a-simple-function - input fields: default-value vs value - logic check: does the component to update deref the ratom? - defmethod based components can be wonky in reagent - on-js-reload should re-mount root component

gadfly36118:11:07

With the help of @andre, a re-frisk option as been added to re-frame-template. lein new re-frame myapp +re-frisk

naomarik18:11:23

maybe i’m doing something silly but i’ve just noticed i don’t really have reloadability when i’m coding my subscriptions using figwheel. any ideas? using version 0.8.0

naomarik18:11:00

i do get the message re-frame: overwriting :sub handler for: :subscription-name but it just sticks with what was there when the page loaded

naomarik18:11:14

btw @jstaffans I just made it so my initialize event checks to see if DB is empty? before it throws anything in it and my state is preserved

joshkh18:11:57

does it make sense to investigate Rum as an alternative to reagent in the context of a re-frame application?

naomarik19:11:48

amazing I just found clear-subscription-cache!

naomarik19:11:59

exactly what i needed in the new alpha

mikethompson21:11:20

@vikeri what are you rebinding with with-redefs ?

mikethompson21:11:08

@vikeri oh, now I get what you are saying.

mikethompson21:11:06

Yes, you are right. dispatch is async. So the event handling will happen "later" after the scope of the with-redef

mikethompson21:11:23

@joshkh It certainly makes sense. But you'd have to adapt re-frame to Rum, creating a sibling library called perhaps re-bellion (the "Rum rebellion" was a piece of Australian History. I'll get my hat.) so there would be some work involved.