Fork me on GitHub
#re-frame
<
2020-05-30
>
folcon10:05:04

Is dispatch-n’s order undefined? I recall it running things from left to right?

p-himik10:05:46

It's not stated explicitly to be ordered. But it explicitly requires a sequential collection and it just calls dispatch in order.

folcon10:05:40

Yea, I didn’t realise that wasn’t part of it’s contract, so it could change order at some point in the future?

p-himik11:05:58

The probability is not 0 on the infinite timeline. :P But I really doubt that it will ever happen. Same as with the js/console.log syntax never going away.

p-himik11:05:37

Even if it breaks with some re-frame update, you could just override it with your own version of :dispatch-n that does everything in the order you desire.

folcon11:05:09

😃 A fair point

David Pham15:05:37

Is there a way to define end to end testing with events in reframe?

David Pham15:05:59

Something like running the app and dispatching the events in. Headless browser?

Dmytro Bunin15:05:18

why not simulate the user clicks with something like [cypress](https://github.com/cypress-io/cypress)

David Pham07:05:21

Thanks a lot. I will try it. The reason I want to have events is they have better semantics than clicks.