Ensure that add-player-of-game function is idempotent
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
This commit is contained in:
parent
6e0f0237b3
commit
977ab9ea3a
|
@ -7,7 +7,7 @@
|
|||
(get-in state [:games game]))
|
||||
|
||||
(defn add-player-of-game [state game player]
|
||||
(update-in state [:games game] #(conj % player)))
|
||||
(update-in state [:games game] #(set (conj % player))))
|
||||
|
||||
(defn remove-player-of-game [state game player]
|
||||
(update-in state [:games game] #(disj % player)))
|
||||
|
|
Loading…
Reference in New Issue