squint
squint copied to clipboard
Qwik QRL
In the Qwik Framework, they have a concept of QRL.
I have the following button
:
(ns app
(:require ["@builder.io/qwik" :refer [component$ useSignal]]
["./app.css"]))
(defn -App []
(let [count (useSignal 0)]
#jsx [:button {:onClick$ #(set! (.-value count) (inc (.-value count)))}
"count is " (.-value count)]))
(def App (component$ -App))
This is the output
<button onClick$={(function () {return count1.value = (count1.value + 1);})}>count is {count1.value}</button>
This would be the ideal output:
<button onClick$={() => { return count1.value = (count1.value + 1);}}>count is {count1.value}</button>
Qwiks $ optimiser needs serializable values.