Fork me on GitHub
#re-frame
<
2019-01-12
>
Socks01:01:12

What determines the execution order of events? I know dispatch has no order so {dispach-n [[:a][:b]]} might result in a or b happening in any order. But if a and by both dispatch

a-->c
b-->d
I'm not sure if i can expect a and b to have finished before c. So lets say c is a reg-fx that increments a counter by 1. and b is a normal reg-event-fx, but it dispatches to a reg-fx d that decrements the counter by 1. Does anything in reframe order them or is both orders: c,d and d,c possible? So at any point, the counter could be -1, 0, 1 (assuming it started at 0).

mikethompson03:01:56

@brewmasterv events are handled FIFO

mikethompson03:01:12

So {dispach-n [[:a][:b]]} will mean that [:a] is fully processed before [:b] is processed

Socks06:01:49

@mikethompson ah right, i meant if if the effects map is {:a something :b something}

Socks06:01:06

but i didnt even know dispatch n worked that way so thats good to know

mikethompson06:01:25

There is no ordering to the processing of effects