Fork me on GitHub
#re-frame
<
2018-01-23
>
fabrao01:01:04

hello all, if I use :value @(rf/subscribe [:something])direct into input field why it don´t update if I change the value?

danielcompton02:01:48

@fabrao input fields are a bit tricky with reagent, can you give some more info?

danielcompton02:01:05

We use re-com to mask over these issues, I'm sure there are other approaches as well

fabrao03:01:01

my question is can I use it direct to value? Or do I have to pass it as parameter?

danielcompton07:01:30

Not sure what the difference is sorry?

shaun-mahood18:01:53

@conan: Are you starting from a template?

conan18:01:23

Not in this case no

conan18:01:33

Copying from the reframe template

shaun-mahood18:01:24

Ok, there's (I think) only a few places where this can go wrong (I've done them all more than once) - You need to call your init function from your html page - `<script>app.core.main();</script> - You need to export your main function - (defn ^:export main []) (you've already got this I think) - You need to include re-frame in your main app file

shaun-mahood18:01:55

First thing I would check is do a js alert or println from your main function and see if it's showing up when you start your app - if it is then you can focus on what your re-frame init is supposed to be doing

p-himik18:01:23

Is the first point necessary? I don't call it from my HTML page, I just have a relevant :main entry in the compiler configuration.

p-himik18:01:15

Ah, nevermind - I have (set! (.-onload js/window) main). I forgot about it.

shaun-mahood18:01:00

@conan: It's not a perfect presentation by any means, but if you're still having trouble getting the start up going you may find something useful in my talk from the 2016 conj - https://www.youtube.com/watch?v=cDzjlx6otCU - matching code is at https://github.com/smahood/re-frame-conj-2016 It should give you a pretty decent walkthrough of how to get your initialization done with decent reloading (though it's been a while so it may not be as useful as I hoped).

conan18:01:42

I think my html is missing the call

conan18:01:20

I’ll check tomorrow but I have a feeling that’s it