-
-
Save ZachMassia/470a57e5e7a0169667c9 to your computer and use it in GitHub Desktop.
Is do-all needed in this case to force all the calls to update?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn update-state | |
"Update each entity if it has an update fn." | |
[event world-state] | |
(update-in world-state [:entities] | |
#(doall (map (fn [ent] | |
(if-let [update (:update ent)] | |
(update event world-state ent) | |
ent)) | |
%)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment