Hi. What's the best way to "hot-reload" go blocks in Figwheel?
@andrewboltachev: go blocks themselves are no problem, its normally go loops that are a problem
@bhauman: yes
so there is a simple trick to making go-loops reloadable
a kill channel?
farm out the body of the go loop to a simple function that returns a go block
the function is very reloadable
and then defonce the go-loop itself
aha, it's like (defonce _ (do ...this would be executed only once...))
the loop is stateful and will pickup the new body def the next time around
you could also dispatch different parts of the loop to different funs, etc..
aha, thanks, seems that I understood 🙂 I'll try that
🙂
btw. I have to say: the reason I'm having problems like that I that I moved away from React stuff. And now wanna to make use of all that js/document.createElement
etc. But you @bhauman are advocating it. My arguments now are that React makes impossible all that "install-and-go" things like jQuery UI, WYSIWYG editros, other components, and I'm not sure but guess so also canvas libraries like sigma.js. Do you think it's a good arguments to move away from React in that case?
@andrewboltachev: it depends on what you are doing ... there are trade offs. But if you are going to do any sizable client side project I would use React for sure ...
if you are just adding some simple functionality to some brochureware website
no need
I would personally almost always use react...
but there is a learning curve
I'm rather for a complex webapp/visual editor (and even more)
imperative programming always feels like you are getting more done, but you pay for that later on when its impossible to reason about your site