 (defn get-data-state [element]
   (.getAttribute element "data-state"))
 
-(defn- enter-data-state! [element state old-state]
-  (when-let [enter-transition (get-transition element (keyword (str "on-" state)))]
-    (enter-transition element old-state)))
+(defn- enter-data-state! [element node-state state old-state]
+  )
 
 (defn set-data-state!
   ([element state]
     (let [cur-state (get-data-state element)
+          node-state (get-element-state element)
           state (when state (name state))]
       (when-not (identical? cur-state state)
         (do-set-data-state! element state)
-        (enter-data-state! element state cur-state)))))
+        (when-let [enter-transition (get-state-attr node-state (str "state/on-" state))]
+          (enter-transition element old-state state))))))
 
 (defn- bind-prop-attr! [set-fn element attr-name attr-value node-state]
   (if (satisfies? cljs.core/IDeref attr-value)

              (when-not (.-disposed state)
                (let [new-elem (get-new-elem)
                      cur (.-cur-element state)
                      cur-state (get-element-state cur)]
                  (when-not (identical? (get-virtual-dom cur) (get-virtual-dom new-elem))
                    (if-let [hide (when cur-state
                                    (aget cur-state "node-on-detaching"))]
                      (hide cur
                            (fn []
                              (if (.-disposed state)

        (.removeAttribute element attr-name)))))

(defn- bind-lifecycle-callback! [node node-state cb-name cb-value]
  (when (identical? cb-name "disposed")
    (set! (.-disposed-callback node-state) cb-value)
    ;; other callbacks automatically included in attr map
    ))

(def ^:private attr-ns-lookup
  #js
  {:node bind-lifecycle-callback!
   :state (fn []) ;; automatically handled in attr map
   })

(defn register-attr-prefix! [prefix xml-ns-or-handler]
  (aset attr-ns-lookup prefix xml-ns-or-handler))
