Change how recording is started
This commit is contained in:
@@ -64,11 +64,11 @@
|
||||
(defn ^:private add-to-timeline!
|
||||
[screen-atom entities]
|
||||
(let [screen @screen-atom]
|
||||
(when (:record? screen)
|
||||
(when (:timeline screen)
|
||||
(swap! screen-atom
|
||||
update-in
|
||||
[:timeline]
|
||||
#(conj (or %1 []) %2)
|
||||
conj
|
||||
[(:total-time screen) entities]))))
|
||||
|
||||
(defn defscreen*
|
||||
|
||||
@@ -80,8 +80,8 @@ specified path.
|
||||
|
||||
(defn rewind!
|
||||
"Returns the most recent entities vector saved in the timeline after removing
|
||||
the last `steps` from it. The timeline is recorded by calling
|
||||
`(update! screen :record? true)`.
|
||||
the last `steps` from it. Start recording to the timeline by calling
|
||||
`(update! screen :timeline [])`.
|
||||
|
||||
If there are 100 items saved in the timeline and `(rewind! screen 1)` is called,
|
||||
it will remove the last one and return the entities vector from the 99th item.
|
||||
|
||||
Reference in New Issue
Block a user