Fork me on GitHub
#re-frame
<
2020-01-29
>
Oz14:01:33

Another noob question here, I have in my app db a map with many keys and values, I want to auto-generate subs to these values when the application loads, before it renders. I've made a function that creates the subs, and calling it manually from the repl works, but I'm not sure how to call it when the app loads. Do you have a hint? Thank you!

shaun-mahood15:01:02

If I understand your question correctly, you should be able to call that function in your main ClojureScript file right before you call your render function, or in the same place as you would put any other reg-sub function calls.

👍 1
Oz16:01:37

Works! Also had to initialize my fake data there because originally it was getting generated later, meanwhile leaving my components heartbroken and not loading. thanks 🙂

shaun-mahood16:01:22

No problem, glad you got it working!

knubie19:01:28

Anyone know of the best way for handling images in react native with shadow? https://facebook.github.io/react-native/docs/images

lilactown19:01:47

you could try using js/require directly

knubie20:01:06

Whoops, thought I was in #shadow-cljs already 😅

knubie20:01:13

Thanks for the suggestion though.

lilactown19:01:14

I would ask in #shadow-cljs tho

Wilson Velez19:01:43

I hope you can point me in the right direction, I am working on re-frame app, there is column to mark favorites, I want this favorite thing to be a separate component, separete project, because I’m planning to use it in another set of components, how can I do that? is there any tutorial?

Wilson Velez21:01:01

@isak thanks I will take a look (I shouldn’t say that but was there ☺️)

🙂 1