squint icon indicating copy to clipboard operation
squint copied to clipboard

defclass static methods and fields

Open brandonstubbs opened this issue 11 months ago • 5 comments

It would be great if defclass could support static methods and fields as it's widely available now.

At the moment as a workaround I am doing the following as mentioned here (https://clojureverse.org/t/modern-js-with-cljs-class-and-template-literals/7450/6):

(defclass DisplayVar
  (extends HTMLElement)
  (constructor [this]
    (super))

  Object
  (attributeChangedCallback [this name old-val new-val]
    (js/console.log name old-val new-val)))

(set! (.-observedAttributes DisplayVar) ["variable"])

brandonstubbs avatar Mar 26 '24 15:03 brandonstubbs