Fork me on GitHub
David Pham07:06:48

I guess you would use s/cat a lot

David Pham07:06:35

I still donโ€™t know how you can spec a JS object


is there any way for me to update a component every time a function runs through a loop? I have a function that conjs a string onto an atom on every loop and I want a component to update the displaying of the string incrementally


If by "in a loop" you actually mean loop, then I don't think so because by hogging the only thread the browser's JS has, you prevent anything from re-rendering.


ah thats unfortunate ๐Ÿ˜ž thank you


I've tried that and it seems to halt the loop where I call it


I'll try to see if I can implement the same function without the loop


You can employ requestAnimationFrame to split the iterations. This way, the browser will have a chance to render something between the iterations.


I looked up how to use requestAnimationFrame and I still don't quite understand how to use it. Could you elaborate?


I tried calling (.requestAnimationFrame js/window output) at the end of the loop, and it doesn't seem to be doing anything worthwile


You completely replace loop with calls to requestAnimationFrame.

๐Ÿ‘ 6

whoa. Really cool. Thank you!

๐Ÿ‘ 3