Fork me on GitHub
#reagent
<
2017-04-20
>
souenzzo11:04:41

@tomaas both "on" fns should be on let?!

tomaas11:04:31

@souenzzo, I'll already seen the issue, thanks

tomaas11:04:26

the problem I have now is this: I receive a javascript File as an argument and try to do (.readAsDataURL (js/FileReader.) %) where % is an instance of File. I get nil 😕

tomaas11:04:05

oh, I think I'm missing load event on FileReader

souenzzo11:04:28

JS callback helllllll

savelichalex11:04:44

@tomaas I create my own realization of dropzone, which is implementation of react-dropzone in cljs) If you want I can share code

tomaas11:04:08

@savelichalex of course, thank you

tomaas11:04:24

for now I did it this way

gamecubate18:04:15

Hi everyone. Using reagent to render an SVG circle, storing its center (cx) position inside a ratom. When cx changes, does this mean that reagent will delete the old circle and insert a new one at the new position? If so, is there a way to prevent this overwork (assuming it is more work than just moving the circle to its new position)?

gamecubate18:04:02

I guess I could find my answer by making a custom reagent component and checking how often it is unmounted.

noisesmith18:04:07

if it remains the same component, reagent knows it doesn’t need to destroy it, since it is parameterized by the ratom, reagent knows to re-render when the ratom changes

noisesmith18:04:21

this is no different between svg or div

gamecubate18:04:07

so there would be no component-did-unmount call, correct?

noisesmith18:04:25

as I understand it that is correct

gamecubate18:04:47

okay thanks. Was asking because am doing SVG renderer tests for a physics lib (planck.js)’s bodies and performance seemed a bit… “flickery”. Not sure yet, though. Thanks again. Will push things (more bodies) a bit to see how well it holds.

noisesmith18:04:45

if you have a list of svgs, you should use the ^:id metadata so it can optimize the re-render as the data changes

noisesmith18:04:54

but it should warn you about this in the console too

gamecubate18:04:24

Only one svg but there will up to 100 circles bumping about, ideally 60 times per second.

gamecubate18:04:50

I could do that…. giving each one a unique id.