Skip to content

Instantly share code, notes, and snippets.

@ZachMassia
Created March 4, 2014 01:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ZachMassia/470a57e5e7a0169667c9 to your computer and use it in GitHub Desktop.
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?
(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