Fork me on GitHub
#cljsrn
<
2016-10-04
>
pvinis13:10:03

hello. I was trying the re-navigate app (one of the examples in re-natals repo) and if I tap the "next" button twice or more but quickly, the app breaks

pvinis13:10:16

is that because of 'dispatch'

pvinis13:10:37

should it be using dispatch-sync or something? is there a way to fix that?

vikeri13:10:26

@pvinis, interesting, in what way does it break?

pvinis13:10:22

I mean it crashes

pvinis13:10:37

and as far as I saw, it's because of dispatch?

pvinis13:10:53

does it not happen to you?

vikeri13:10:24

@pvinis Yes, I was able to reproduce it, it seems the handler is not idempotent

pvinis13:10:38

what does that mean?

vikeri13:10:28

The function mutates the state multiple times when it should not

pvinis14:10:30

so what would be the fix here?

misha15:10:40

"Disable button after first click" would be one way to fix it

misha15:10:40

"Make mutating function idempotent" - another