hyperfiddle

2025-03-30T20:48:09.287439Z

Small doc string error?… The doc string for dom/text says it returns the last argument but I think it returns (e/amb) (as stated at https://electric.hyperfiddle.net/tutorial/temperature2 for example).

Dustin Getz (Hyperfiddle) 2025-03-31T01:33:54.050429Z

are you sure?

2025-03-31T11:19:01.650539Z

Pretty sure. I was playing with that example. The following prints nil:

(println (dom/dt))
The following prints nothing:
(println (dom/text))

2025-03-31T11:19:33.654649Z

Oh, did you mean the doc string? I have:

(defmacro text
  "Mount a DOM TextNode in current `node` for each argument in `args`.
   Each TextNode will contain the stringified argument.
   Return last argument as in `do`."
  [& args] `(e/drain ~@(for [arg args] `($ Text ~arg))))

Dustin Getz (Hyperfiddle) 2025-03-31T11:22:28.447239Z

ah my mistake, the docstring is wrong

👍 1