continued refactoring actions

This commit is contained in:
2014-09-16 23:18:36 -07:00
parent d86ea452ab
commit 8f32ec50d3
2 changed files with 85 additions and 97 deletions

View File

@@ -79,8 +79,10 @@
(let [entities (if started? entities (actions/begin current screen entities))
entities (actions/continue current screen entities)]
(if (actions/done? current screen entities)
(recur screen (assoc (actions/terminate current screen entities)
:actions {:channel channel :current nil :started? false}))
(let [terminated (actions/terminate current screen entities)]
(put! (actions/get-channel current) terminated)
(recur screen (assoc terminated
:actions {:channel channel :current nil :started? false})))
(assoc-in entities [:actions :started?] true)))
(let [[current _] (alts!! [channel] :default nil)]
(assoc entities :actions {:channel channel :current current :started? false}))))