                        (.destroy slider))
                      (dissoc state ::slider ::handler)))})
 
-(rum/defcs slider-control < bs-slider rum/static [state value event-bus min max step]
+(rum/defcs slider-control < (bs-slider "#slider" :slider-axis-value) rum/static [state value min max step]
   #_(prn "called slider-control with " value)
   (let [s [:#slider.slider
            [:input {:type "text"



;; returns a bootstrap slider mixin
(def bs-slider
  {:did-mount (fn [state]
                (prn "mounting-slider")
                (let [slider (new js/Slider "#slider"
                                                       (clj->js {
                                                                 :tooltip "hide"
                                                                 :min 0
                                                                 :max 1
                                                                 :step 0.1
                                                                 :value (:slider-axis-value @core/app)
                                                                 }))
                      handler #(do
                                 (put! event-bus [:slider-axis-value (.getValue slider) %]))
                      state' (assoc state ::slider slider ::handler handler)]

                  (.on slider "slide" handler)

      (.setValue slider value))
    s))

(rum/defcs slider2-control < (bs-slider "#slider2" :slider2-axis-value) rum/static [state value min max step]
  (let [s [:#slider2.slider
           [:input {:type "text"
                    :data-slider-min min
                    :data-slider-max max
                    :data-slider-step step
                    }]]
        slider (::slider state)]
    (when slider
      (.setValue slider value))
    s))

(rum/defc axis-container < rum/static [slider-axis-value]
  [:.axis-container
