Fork me on GitHub
#re-frame
<
2018-02-22
>
fabrao00:02:29

As I see, dispatch-n is a doseq dispatch. How about side effects? Do it control concurency at ALL?

danielcompton01:02:08

@fabrao can you explain your question further? re-frame processes events in the order they are received, and runs all fx synchronously (of course an fx can itself make an async action)

danielcompton01:02:21

dispatch-n itself is only dispatching the events onto the re-frame queue

seako05:02:57

@feihong.hsu can you share a snippet that shows what you're doing in your click handler and what you're doing in your effect handler?

seako17:02:30

i tried to start this project with lein figwheel but when i point my browser at localhost it renders the figwheel 404

seako18:02:46

how are you starting up this project locally?

seako18:02:26

nothing is popping out at me just glancing at the code. i think if i were able to poke around in the running application i might be able to find something.

seako07:02:13

you might try using dispatch-sync it's for latency sensitive situations like this one

feihong07:02:57

@seako i also tried creating a much simpler project to try to isolate the problem, but unfortunately, everything works fine. so there is something else going on.

curlyfry08:02:22

@feihong.hsu Sorry for not addressing the question you're actually asking (not very familiar with the speechSynthesis api), but regarding your comment ; Is there a way to turn this into a pure function? in your code: The answer is reg-fx https://github.com/Day8/re-frame/blob/master/docs/Effects.md#extensible-side-effects

iku00088808:02:21

It is really a weird question, but has anyone experienced a subscription constantly returning a #<Reaction : nil> at the cljs-repl?

iku00088808:02:05

Even though it seems like all the components subscribing to it see some contents

iku00088808:02:07

> Improve cache eviction behaviour of subscription caches. In more complex applications a subscription may have been unnecessarily created and destroyed several times after a Figwheel re-render.

iku00088808:02:36

I did find the line above in the changelog so I upgraded re-frame but issue still seems to persist...

mikethompson08:02:23

subscriptions do, indeed, return a reaction.

mikethompson08:02:56

Stick a @ in front to obtain the value

iku00088808:02:53

Sorry, should have mentioned that returns nil

iku00088808:02:58

which makes me :thinking_face:

iku00088808:02:20

(after sticking an @)

mikethompson08:02:03

I wonder if re-frame-10x would help you to figure out what's happening

mikethompson08:02:22

You can look at subs tab

iku00088808:02:44

Sounds like the right occasion to finally check it out 🙂

mikethompson08:02:27

Yeah, I'm not sure of your intent in looking at a subscription at the repl

mikethompson08:02:00

If you simply want to see what value it currently has, then re-frame-10x is what you neeed

iku00088808:02:33

Yep. Inspection is exactly what I need

iku00088808:02:48

was my habit to doit at the repl

joelsanchez08:02:02

running subscriptions in the repl is very helpful though...I wouldn't dismiss the idea 🙂

joelsanchez08:02:26

if you js/console.log the result of a subscription and you have cljs-devtools installed/enabled, you can interactively explore the data in the console btw

joelsanchez08:02:38

(of course re-frame-10x solves all of that but...)

iku00088809:02:35

yeah, I have all those goodies and fine there

iku00088809:02:54

Only at the repl is where the value is nil

iku00088809:02:37

I will move on with life with those tools for now. Thanks!

iku00088809:02:59

Just installed re-frame-10x and love the first impression!

iku00088809:02:20

I did have to disable it after finding that it somehow makes the React components stop working in weird ways, but good stuff non the less!

mikethompson19:02:52

@iku000888 I'd be keen to get a more specific bug report for any problems you encountered

danielcompton20:02:59

@iku000888 which version of react are you using?

iku00088823:02:46

Hi @danielcompton The specific project was "react-dom": "15.5.4"

mikethompson23:02:13

@iku000888 so just to be clear, you are saying that this React component stopped working when you inistalled re-frame-10x or it stopped working when you started tracing with re-frame-10x? And when you say it stopped working, can you be more specific? What should we look for?

iku00088823:02:42

Thanks for your patience. installing(regardless of tracing/not) re-frame-10x itself caused the react component under question to stop working

iku00088823:02:19

and by stop working, I mean I cannot get rid of the pop out once visible

iku00088823:02:26

and yeah I would love to give a nice isolated repro but this project uses a rather non trivial set up with webpack etc...

danielcompton23:02:06

Do you mean that when you just added the dependency it stopped working?

iku00088823:02:50

added the pre-load config and closure-defines

iku00088823:02:53

> You must be running with the Closure define goog.DEBUG as false

danielcompton23:02:58

just fixed docs

iku00088823:02:09

but yeah prerequisites are followed and can confirm tracing works via ctrl+h

danielcompton23:02:57

> and by stop working, I mean I cannot get rid of the pop out once visible Which popout? the re-frame-10x panel or your date one?