Skip to content

Instantly share code, notes, and snippets.

@ZachMassia ZachMassia/update.cljs Secret
Created Mar 4, 2014

Embed
What would you like to do?
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
You can’t perform that action at this time.