simplify. remove tick

This commit is contained in:
2026-01-22 22:22:19 -05:00
parent 8cb4c82daa
commit 8c7cb24171
9 changed files with 133 additions and 88 deletions
+5 -5
View File
@@ -32,10 +32,10 @@
(tui/key= msg [:ctrl \c]))
[model tui/quit]
;; Tick - advance frame
(= (first msg) :tick)
;; Spinner frame - advance animation
(= msg :spinner-frame)
(if (:loading model)
[(update model :frame inc) (tui/tick 80)]
[(update model :frame inc) (tui/after 80 :spinner-frame)]
[model nil])
;; Space - simulate completion
@@ -53,7 +53,7 @@
;; r - restart
(tui/key= msg "r")
[(assoc model :loading true :frame 0 :message "Loading...")
(tui/tick 80)]
(tui/after 80 :spinner-frame)]
:else
[model nil]))
@@ -86,5 +86,5 @@
(tui/run {:init initial-model
:update update-model
:view view
:init-cmd (tui/tick 80)})
:init-cmd (tui/after 80 :spinner-frame)})
(println "Spinner demo finished."))