Fork me on GitHub
#clojurescript
<
2021-10-07
>
maverick11:10:19

I am doing (reset! value false) for reagent atom but it is showing me true.

maverick11:10:35

Defined atom as (def value (r/atom false))

borkdude12:10:37

@anshbenew need more context. standalone isolated repro

borkdude12:10:46

or link to public code

maverick12:10:18

Defined (def is-test (r/atom true)) in reagent and when I try to reset this value it is still showing true.

Ivan Fedorov14:10:12

showing true where? because if it’s in a view – then you may be missing keying aspect of reagent so a more complete ns example is indeed required, as borkdude asked

borkdude12:10:02

I understand, but this is not enough information to diagnose your problem. You need to show us your code or an isolated reproduction of your problem.

borkdude12:10:15

One problem could for example be that you are using a form-2 component and are dereferencing the atom outside of the returned function. Etc.

maverick13:10:31

Yes, I have two component one is main.cljs and other is form.cljs I have declared my atom in form.cljsas (def is-test (r/atom true)) and then I am setting its value as false from main.cljs but when I am trying to print that value in form.cljs it is printing true only.

borkdude12:10:16

Make a single example.cljs file with a stripped down version of your problem and paste it as a http://gist.github.com

🎯 1
Ivan Fedorov14:10:31

Anyone worked with Vega? Is it possible to snatch out the layout data out of it? Maybe @metasoarous with his wonderful “Oz” knows how. I’m drawing a tree graph, and d3.layout.tree(root).nodes() in the end has the x,y coordinates for where the nodes should be.

metasoarous19:10:44

Hey @ognivo! You're in luck; I just added a :view-callback option to the oz/vega and oz/vega-lite components, so that you can capture the vega.View object, and use the view api to get at this information.

❤️ 1
Ivan Fedorov11:10:47

whoa, thanks a lot Christopher! in luck indeed

metasoarous19:10:53

This is admittedly not particularly ergonomic, but I do have plans to add more convenient listener functions so that you don't have to hack around with the view api directly: https://github.com/metasoarous/oz/issues/13

metasoarous19:10:43

It's nice to start with the view api though, since then you get access to everything it has to offer and can "go nuts". But conveniences to boot will be nice.

metasoarous19:10:55

You can try all of this out on 1.6.0-alpha35

metasoarous19:10:33

PS There is a #datavis channel should you care to continue discussions over there without cluttering up the #clojurescript channel.

cap10morgan21:10:56

Anyone ever consumed a :target :bundle CLJS lib from TypeScript? Can't seem to figure out how to import it correctly on the TypeScript side.

pesterhazy19:10:02

Are you using shadow-cljs?

pesterhazy19:10:28

The npm-module target might help

cap10morgan20:10:20

I wasn't but concluded that I probably need to be 🙂