Skip to content

Commit f5e23fd

Browse files
Mike Thompsonclaude
andcommitted
Remove alpha toggle demo from todomvc example
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a92ec9a commit f5e23fd

File tree

3 files changed

+0
-24
lines changed

3 files changed

+0
-24
lines changed

examples/todomvc/src/todomvc/events.cljs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -207,17 +207,3 @@
207207
(reduce #(assoc-in %1 [%2 :done] new-done)
208208
todos
209209
(keys todos)))))
210-
211-
;; TODO: I'd like to do this.
212-
;; I think it requires the :alpha subscription to have a :set method.
213-
#_(reg :event :toggle-alpha :<- :alpha? :-> not)
214-
215-
(reg-event-db
216-
:toggle-alpha
217-
(fn [db _]
218-
;; don't need to know the path any more.
219-
;; can compute the sub instead.
220-
;; it's memory-safe.
221-
(let [alpha? @(sub :alpha?)]
222-
;; still need to know the path to update the value.
223-
(update-in db [:very :long :path :alpha?] not))))

examples/todomvc/src/todomvc/subs.cljs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,5 +160,3 @@
160160
:<- [:completed-count]
161161
(fn [[todos completed] _]
162162
[(- (count todos) completed) completed]))
163-
164-
(reg :sub :alpha? :-> (comp :alpha? :path :long :very))

examples/todomvc/src/todomvc/views.cljs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,9 @@
9191
:on-save #(when (seq %)
9292
(dispatch [:add-todo %]))}]])
9393

94-
(defn alpha []
95-
(let [alpha? @(sub :alpha?)]
96-
[:a {:href "#"
97-
:style {:color (if alpha? "red" "gray")}
98-
:on-click #(dispatch [:toggle-alpha])}
99-
(if alpha? "alpha is running!" "try alpha?")]))
100-
10194
(defn todo-app
10295
[]
10396
[:<>
104-
[alpha]
10597
[:section#todoapp
10698
[task-entry]
10799
(when (seq @(subscribe [:todos]))

0 commit comments

Comments
 (0)