Skip to content
Browse files

Issue #1 Resolution - stacking submit event listeners

Prevent adding multiple event listeners on "submit" for each reload.
This was causing n new events when add button pressed
  • Loading branch information
athomasoriginal committed Sep 23, 2019
1 parent b26c1aa commit ceb1ae2b907eb8c04befcb30c21e9bab81706000
Showing with 11 additions and 4 deletions.
  1. +11 −4 src/demo_reloadable_code/calendar.cljs
@@ -165,16 +165,23 @@

; Register event listeners

(.. js/document (querySelector ".calendar-form"))
(defn ^:before-load teardown []
(.querySelector js/document ".calendar-form")))

(defn ^:after-load setup []
(.. js/document (querySelector ".calendar-form"))

(.. js/document (querySelector "#event_start"))

(defonce initial-load (setup))

;; Init

0 comments on commit ceb1ae2

Please sign in to comment.
You can’t perform that action at this time.