(defn
set-id-class
[p id-class]
(let
[id
($ id-class :id)
p
(if (and (some? id) (nil? (oget p "id"))) (oset p "id" id) p)]
(if-some
[class ($ id-class :className)]
(let
[old (oget p "className")]
(oset p "className" (if (nil? old) class (str class " " old))))
p)))