squint icon indicating copy to clipboard operation
squint copied to clipboard

Qwik QRL

Open brandonstubbs opened this issue 11 months ago • 13 comments

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.

brandonstubbs avatar Mar 30 '24 15:03 brandonstubbs