Fork me on GitHub
#re-frame
<
2018-02-19
>
v3ga05:02:53

Can someone tell me why this doesn’t work? I’m trying to show all of my state on screen. https://gist.github.com/anonymous/c3e591259303ade8efa0e1bef284f7f7

p-himik05:02:57

@decim It should be (rf/subscribe [:dashboard]).

v3ga05:02:25

@p-himik oh crap! thanks

mac17:02:04

I just created a new project using the re-frame template and included cljsjs/semantic-ui-react "0.77.2-0" - this results in the following errors when trying to require cljsjs.semantic-ui-react : Uncaught TypeError: Cannot read property 'ReactComponentTreeHook' of undefined and Uncaught Error: js/ReactDOM is missing - any idea as to what is wrong and how I can fix it?

mac17:02:00

Ah, problem resolved. Excluding react and react-dom from the cljsjs/semantic-ui-react "0.77.2-0" dependency like this [cljsjs/semantic-ui-react "0.77.2-0" :exclusions [cljsjs/react cljsjs/react-dom]] did the trick.

jonr22:02:20

Yo channel. Anyone have any experience using a graphics rendering system like three.js with re-frame? I’m driving scene updates in a three.js project with reagent/tracked re-frame subs and my re-trace is going to 💥. Would be really interested to hear if anyone has any thoughts or strategies

Henry22:02:16

Aloha. If I want to update a value on a certain index of a vector in reg-event-db … how would i do it? So this is what I have, which doesn’t work

(reg-event-db
  :set-my-vector
  (fn [db [_ new_value index]]
    (assoc db :my-vector-in-db index new_value)))

Henry22:02:46

Do I need to use update or update in?

manutter5122:02:07

I believe you want assoc-in

manutter5122:02:43

(assoc-in db [:my-vector :in-db index] new-value)

Henry22:02:25

what is :in-db for?

manutter5122:02:53

Just dummy data, sorry

Henry22:02:25

(assoc-in db [:my-vector index] new-value)
so this should work?

manutter5122:02:17

I believe so, not sure about assoc’ing vectors now that I think about it

Henry22:02:46

well i give it a shot, i can tell u in a second

manutter5122:02:48

ok, checked the docs that should work

manutter5122:02:10

When applied to a vector, returns a new vector that
  contains val at index. Note - index must be <= (count vector).

Henry22:02:16

It works, thanks a lot ❤️