joyride 2023-02-09

clojurescript beginner question — how would I get the names of my terminal windows in joyride? vscode/window.terminals starts with

#js {:name "left", :processId #<Promise[~]>, ....
and I’d like to retrieve that name, like, of all my terminal windows. I’ve tried (map #(.name %) vscode/window.terminals) but it gives me
; Function.prototype.apply was called on left, which is a string and not a function
I’m a bit lost 😳

@stephan.renatus You're close: (map #(.-name %) ...)

💡 1

You can also convert the JS value to CLJS first and then process it

with #(js->clj % :keywordize-keys true)

thank you!

lol now that I know the answer it was easy to find https://cljs.github.io/api/syntax/dot 😄

> (.foo bar) => bar.foo() and that’s why I got the apply-of-string error.

👍 2

Would it make sense to think about a "joyride" for Logseq? Could it reuse much of the code?