Just curious about the use of `swap!` on this line, https://github.com/http-kit/chat-websocket/blob/master/src-cljs/main.cljs#L36, where you have ``` (swap! max-id #(.-id msg)) ``` in case there is concurrency I'm not aware of. Wouldn't `(reset! max-id (.-id msg))` suffice?
Just curious about the use of
swap!on this line, https://github.com/http-kit/chat-websocket/blob/master/src-cljs/main.cljs#L36, where you havein case there is concurrency I'm not aware of.
Wouldn't
(reset! max-id (.-id msg))suffice?