Skip to content

Commit

Permalink
Replaces doseq with doall
Browse files Browse the repository at this point in the history
We replace `doseq` with `doall` because `doall` is idiomatic and removes the unnecessary binding.
  • Loading branch information
Jeel-Shah authored and superstructor committed Feb 13, 2020
1 parent c19b6bf commit 6247cb9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/FAQs/PollADatabaseEvery60.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ OR, you can code defensively for reloading, perhaps like this:
(let [live-intervals (atom {})] ;; storage for live intervals
(fn handler [{:keys [action id frequency event]}] ;; the effect handler
(condp = action
:clean (doseq ;; <--- new. clean up all existing
[_ (map #(handler {:action :end :id %1}) (keys @live-intervals)])
:clean (doall ;; <--- new. clean up all existing
(map #(handler {:action :end :id %1}) (keys @live-intervals))
:start (swap! live-intervals assoc id (js/setInterval #(dispatch event) frequency)))
:end (do (js/clearInterval (get @live-intervals id))
(swap! live-intervals dissoc id))))
Expand Down

0 comments on commit 6247cb9

Please sign in to comment.