helix

stagmoose 2023-09-13T14:42:39.867279Z

if i defnc a component, how can i loop over a vector of items to use that component and put them inside a div? for is lazy. so maybe mapv ? or do i have to write ~@ macro like the todomvc example?

alexdavis 2023-09-13T14:50:05.143949Z

You can wrap for in β€˜doall’

πŸ™ 2
stagmoose 2023-09-13T14:59:10.770379Z

Thanks!

lilactown 2023-09-13T17:39:46.626759Z

lazy seqs are fine to use in helix components

πŸ™ 1
stagmoose 2023-09-13T15:04:27.685259Z

I am confused by this example

(#($ Sentence %) (first mock-data))
;; => #js {"$$typeof" "Symbol(react.element)", :type #object[dudee$core$Sentence_render], :key nil, :ref nil, :props #js {:children {:content "this is 1"}}, :_owner nil, :_store #js {}}
($ Sentence (first mock-data))
;; => #js {"$$typeof" "Symbol(react.element)", :type #object[dudee$core$Sentence_render], :key nil, :ref nil, :props #js {:children {:content "this is 1"}}, :_owner nil, :_store #js {}}
(first mock-data)
;; => {:content "this is 1"}


($ Sentence {:content "this is 1"})
;; => #js {"$$typeof" "Symbol(react.element)", :type #object[dudee$core$Sentence_render], :key nil, :ref nil, :props #js {:content "this is 1"}, :_owner nil, :_store #js {}}
The result of (first mock-data) should imply ($ Sentence (first mock-data)) and ($ Sentence {:content "this is 1"}) are the same, but the result is different! Did I miss anything?

stagmoose 2023-09-13T15:17:16.179529Z

Thanks Derek!! Didn't notice this.

Derek 2023-09-13T22:17:11.358759Z

You're welcome πŸ™‚

πŸ™ 1