Fork me on GitHub
#re-frame
<
2016-07-22
>
michael.heuberger00:07:13

guys, it is possible to dispatch multiple events in one go?

nilrecurring00:07:12

@michael.heuberger: yep you're right, in that way you're dispatching to :a all the rest of the list

nilrecurring00:07:18

In those cases I usually make chains of dispatches (e.g. dispatching once and then dispatching everything else from that handler)

nilrecurring00:07:28

But I would say it depends on your use case

mikethompson00:07:27

@michael.heuberger: can't be done. You have to use multiple dispatch

mikethompson00:07:31

So this:

(dispatch [:a a])
(dispatch [:b b])
(dispatch [:c c])

mikethompson00:07:19

Be careful of this: (map dispatch [[:a a] [:b b] [:c c]]) The laziness of map means nothing is done.

mikethompson00:07:25

So use mapv (not lazy) or perhaps more explicitly wrap in doall to de-lazify the map

michael.heuberger00:07:27

ah, good to know - thanks!

michael.heuberger00:07:30

what would you think of supporting multiple events in re-frame?

danielcompton00:07:28

@michael.heuberger: the new re-frame fx stuff will allow you to dispatch multiple events

michael.heuberger00:07:46

oh, the next version?

danielcompton00:07:49

But that’s more because fx need to be data structures

danielcompton00:07:08

But if you’re doing function calls, a doseq is more idiomatic clojure

michael.heuberger00:07:22

yup, agree - all good, thx guys

mikethompson01:07:21

If you are interested, you can track what's coming in the next version here: https://github.com/Day8/re-frame/blob/develop/CHANGES.md

mikethompson01:07:33

It is a substantial release

rui.yang02:07:24

Hi, if I want to inspect the current state of the db, could I do @re-frame.db/app-db?

jjunior13003:07:10

I think you just write a sub called :app-db and pass the db as is?

rui.yang03:07:34

I am inspecting it directly from figwheel, it gave me wield results, doesn’t seem to sync with the real state. from the Q/A above, seems that I shouldn’t use figwheel to do that 😞

rui.yang03:07:15

@jjunior130: I inspected directly form figwheel repl, and the results it returned wasn’t synced with real state. that’s why I asked here. I was confused. From https://github.com/Day8/re-frame/wiki/FAQ#5-how-can-i-inspect-app-db, using figwheel to do is not recommended. I guess I have to use the workaround in the Q/A

rui.yang03:07:51

I found that I had to kill all browser pages connecting to figwheel to make it work again

rui.yang03:07:30

I’ll stick with it until next time I got stuck. I think this time it might because I have multiple tabs open

martinklepsch11:07:45

very rough but the infinite loop symbol seemed so fitting!

mikethompson12:07:55

Oh, wow. You are talent!!

mikethompson12:07:02

That looks great

mikethompson12:07:15

It even has the dash between the re and the frame. So perfect.

mikethompson12:07:02

I don't know how you did that. But if you have an svg version please create a PR (against develop) and put it in: https://github.com/Day8/re-frame/tree/develop/logo

mikethompson12:07:23

Delete what is in there currently. Yours is so much better.

martinklepsch12:07:33

oh 😯 I'm flattered! ☺️

martinklepsch12:07:54

I can do a PR, I made it with Sketch, should I add the source file as well?

mikethompson12:07:40

And some pngs from it?

mikethompson12:07:57

(I'm not a on a Mac)

martinklepsch12:07:32

Yes, I can add a few pngs and .sketch — I'll also add svg if that exports cleanly

mikethompson12:07:33

A reminder - this is the offical diagram describing the way re-frame works: http://thumbnails-visually.netdna-ssl.com/water-cycle_521f29b8b6271_w1500.png

curlyfry12:07:07

Small heads up: In https://github.com/Day8/re-frame-http-fx It says "Add the following project dependency: Clojars invalid"

martinklepsch12:07:34

@curlyfry: I think that's because it's not yet deployed to Clojars

mikethompson12:07:54

@curlyfry: I'll put it up there. But I'm a bit cautious. We haven't yet had enough chance to use it in the wild. So if you did want to use it, you might be slightly crash test dummy

mikethompson12:07:36

We've written a few of these as a proof of concept for the new Effectful Handlers

richiardiandrea15:07:50

re-frame-http-fx amazing!

richiardiandrea15:07:37

is (def-fx...) already a thing in 0.8.0? You guys are smart 😄

richiardiandrea15:07:07

oh yeah I so dig this, and very very like the pluggability achieved with that fx middleware

mikethompson23:07:10

@richiardiandrea: def-fx is available in alpha2 I'm sorry it is taking so long to get v0.8.0 through to release. It is partially feature creep, and partially that we actually want to exercise the new features before locking in.

richiardiandrea23:07:35

@mikethompson: don't worry I am just asking...thanks for the hard work you do, I want to try the alpha but I am not quite there, I hope I can have soon some great 👍 confirming everything works

mikethompson23:07:26

You may also be interested in: https://github.com/Day8/re-frame-async-flow-fx We're after feedback

richiardiandrea23:07:01

yeah I read that, the feedback is like above: Chapeau! I think this is the missing piece of the framework, now it feels complete, I'll re-read the READMEs anyways and I will get back to you in case I find something

mikethompson23:07:40

Note: this is a library. Is not even a part of re-frame itself. So variations and alternatives can abound.