Fork me on GitHub
#re-frame
<
2018-11-18
>
andrewzhurov11:11:30

I read this issue and wonder https://github.com/Day8/re-frame/issues/299 What benefits purity of view func can give? Talking about testing, if data is what we care, then test flow would be: - (dispatch <evt>) - (expect (subscribe <sub>) <be_such_data>) So no benefits for testing, if I'm not mistaken cc @mikethompson @razum2um

abdullahibra14:11:58

{:db (do something with it) :dispatch [your second event]} to dispatch two how can i dispatch multiple ?

abdullahibra14:11:26

can i do wrap :dispatch val as do block or what the right thing to do it ?

abdullahibra15:11:17

@valtteri that's great thanks

llsouder15:11:34

Hi all. I have a button. On-click calling a function A works. On click calling dispatch which triggers the same function A causes my page to go blank. I see A's print to the console but then I get a blank page.

andrewzhurov15:11:22

Hey, @llsouder Probably you're setting your app-db to a nil by this dispatch If you used reg-event-db - make sure your event handler returns next app-db's state

👍 4
mikethompson21:11:10

@llsouder @brownmoose3q when you use a tool like re-frame-10x or re-frisk, these sorts of problems tend to be easier to diagnose.

✔️ 4
llsouder23:11:08

YES you were correct. I changed my function to return the db and now it works. I am using re-frame-10x and I noticed the 'nil' but I didn't understand it until @brownmoose3q pointed out the need to return the db.

achikin23:11:15

I'm reading this document https://github.com/Day8/re-frame/blob/master/docs/Subscribing-To-External-Data.md and I can't understand why this approach is considered bad. Could someone please explain more on this?