datascript
datascript copied to clipboard
Listener notifications might arrive out-of-order
I’m seeing transactions come in to my d/listen! listener in the wrong order when another listener commits a transaction. Here’s the output from both listeners printing (:tx-data tx-report)
"listener 1" [#datascript/Datom [0 :modal/open :new-outing t true]]
;; inside listener 1 - transacts [[:db/add 0 :modal/open :sign-up]]
"listener 1" [#datascript/Datom [0 :modal/open :new-outing t false] #datascript/Datom [0 :modal/open :sign-up t true]]
"listener 2" [#datascript/Datom [0 :modal/open :new-outing t false] #datascript/Datom [0 :modal/open :sign-up t true]]
"listener 2" [#datascript/Datom [0 :modal/open :new-outing t true]]