active-group/reacl

With two messages in one cycle, an app-state change can get lost

Closed this issue · 0 comments

With two messages in once cycle, where the first changes the app-state, it gets lost if the second is not changing it. So this fails:

(deftest app-state-preservation
  (let [class1 (reacl/class "class1" this state []
                            render (dom/div)
                            handle-message
                            (fn [msg]
                              (if (= :start msg)
                                (reacl/return :message [this :msg2]
                                              :app-state (inc state))
                                (reacl/return))))]
    (let [c (test-util/instantiate&mount class1 0)]
      (test-util/send-message! c :start)
      (is (= 1 (test-util/extract-app-state c))))))