Fork me on GitHub
#clojurescript
<
2019-10-19
>
awb9911:10:46

Does someone know how I can do this script in clojurescript?

sova-soars-the-sora01:10:14

Hi @hoertlehner did you try (require ...) and (function ...) ?

sova-soars-the-sora01:10:34

I'm also curious about how this is done

awb9911:10:29

I am stuck in the part of require(['vega-embed'], function(vegaEmbed) { vegaEmbed('#uuid-%s', spec, {defaultStyle:true})

Pavel Klavík11:10:19

Hi, I am try to get started with Web Workers. Is there a way to transfer arbitrary Clojurescript data structures (arrays, maps, keywords) between worker and the main script?

thheller11:10:10

pr-str and cljs.reader/read-string are the built-ins

Pavel Klavík11:10:37

I see, so the standard approach is to serialize everything into a string?

thheller11:10:53

but https://github.com/cognitect/transit-cljs is a lot faster so might be worth depending on how much data you need to transfer

thheller11:10:16

yes, no other option

Pavel Klavík11:10:16

quite silly 🙂 but the serialization should be sufficient since I am not going to transfer that much

benzap15:10:42

Hey guys, I was wondering if this particular issue will ever be addressed: https://clojuredocs.org/clojure.core/binding#example-5784550fe4b0bafd3e2a049e In summary, any rebound dynamically bound vars can't be used asynchronously. This has bitten me in the past, and i'm wondering if it's even possible to maintain a local context for each rebinding. As it stands, it looks like the binding macro is incomplete within clojurescript, as it opted to use with-redef due to the limitations in NodeJS, and Javascript. Could this potentially be fixed in the future if NodeJS, or if the javascript ecosystem were to incorporate threading?

thheller15:10:30

no, that will never work unless CLJS gets full var support like clojure has. which would make it unsuitable for the browser given that the output would be much larger and no longer support DCE

👍 4
thheller15:10:20

IMHO with-redef is pretty much never a good idea, not even in CLJ

benzap16:10:13

That's a real let down, thank you for your insights @thheller

sova-soars-the-sora01:10:14

Hi @hoertlehner did you try (require ...) and (function ...) ?

sova-soars-the-sora01:10:34

I'm also curious about how this is done