Fork me on GitHub
#joyride
<
2023-02-09
>
Stephan Renatus19:02:04

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 😳

borkdude19:02:52

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

💡 2
borkdude19:02:24

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

borkdude19:02:46

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

Stephan Renatus19:02:34

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

Stephan Renatus19:02:10

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

👍 4
fs4222:02:45

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