Fork me on GitHub
#re-frame
<
2017-04-27
>
dragoncube02:04:58

@danielcompton so in view you would have something like this: (let [view-data (or (re-frame/subscribe sub-stepN) … (re-frame/subscribe sub-step1))] [render-data @data]) ?

dragoncube02:04:07

main question is which sub results view should render

danielcompton02:04:43

hard to say without seeing your exact case, but I guess what you describe there could work?

dragoncube02:04:48

I need to try that approach, I’ll share results

mikepence16:04:10

so far, so good with my medical viewer re-frame project.

mikepence16:04:28

I need to understand the optimal flow of events through the system, next. I guess that means I need to go back to the docs.

mikepence16:04:42

my current problem: user interacts with Big Stateful JS Object (openseadragon). This triggers a callback (image loaded successfully) into my app. I love how easy all of that is. Should that callback event then trigger the dispatch of a re-frame event, and then subscribed UI elements update themselves?

curlyfry17:04:07

@mikepence That sounds reasonable to me!

qqq18:04:56

[rcc/v-box :children
   [[rcc/v-box :children []]
    [:pre "Repl Box Info and sone more more more more more text"]
    [rcc/input-text
     :model "Original"
     :width "100%" 
     :on-change (fn [e])]
    ]]
in the above code, the input text box is shorter than the :pre field

qqq18:04:01

(and how do I fix it)

qqq19:04:49

rcc is re-com.core

gamecubate19:04:40

have you tried styling the element (input) with CSS?

qqq19:04:37

and trusted the :width would do what it said it woul.d

gamecubate19:04:20

Assuming that width is expressed as % of parent. So, what width does v-box have?

gamecubate19:04:34

forget what i said

gamecubate19:04:49

should at least be as wide as :pre el

qqq19:04:08

(defn repl-view []
  [rcc/v-box :children
   [[rcc/v-box :children []]
    [:pre "Repl Box Info and sone more more more more more text"]
    [rcc/input-textarea
     :model "Original"
     :width "1000px" 
     :on-change (fn [e])]
    ]]
  )

qqq19:04:15

width also being ignored there, if I set it to 1000px

gamecubate19:04:19

best is to inspect this in Chrome I would think.

qqq19:04:46

okay, I got it working with :style {:width "1000px"} instead of :width

qqq19:04:50

maybe :width is just ignored or something

gamecubate19:04:44

Ahhhh of course! css styling is emdedded within a :style {…} map. I hadn’t spotted that in your code. Perfectly normal for reagent.

gamecubate19:04:35

In fact, standard reagent (don’t know about re-com) needs all DOM element attributes and properties to be inside a map. Example:

[:h1 {:model :original :on-change f :style {:background :red}} "Click me!"]
.

gamecubate19:04:26

You need to embed your element props and attrs inside a map.

denik20:04:51

When non-nil values are returned from re-frame/reg-event-fx they end up overwriting injected cofx. Is that intended behavior?

benny20:04:32

does something like this work or do i need to destructure after the fact?

(let [{:keys [id name image]} (subscribe [:person person-id])] (println @name))

qqq23:04:43

http://re-demo.s3-website-ap-southeast-2.amazonaws.com/#/splits is thedre a way to say "the right panel will always be atleast 10% of the width" ?